From 0ced736b7b3d8990ee47f1ecd94b9fa9a12131f8 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 29 Mar 2020 13:00:57 +0200 Subject: [PATCH] Fixes #28 Fixes #30 Make it actually incremental --- CHANGELOG.md | 7 +++++++ timemachine | 21 ++++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce6e4db..600b03f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # Changelog +## Release v0.6 + +#### Fixed +- [#30](https://github.com/cytopia/linux-timemachine/issues/30) Actually NOT incremental ? +- [#28](https://github.com/cytopia/linux-timemachine/issues/28) Incremental issue + + ## Release v0.5 #### Fixed diff --git a/timemachine b/timemachine index 30955ed..8e1d3e5 100755 --- a/timemachine +++ b/timemachine @@ -12,7 +12,7 @@ MY_DESC="OSX-like timemachine cli script for Linux and BSD (and even OSX)" MY_PROJ="https://github.com/cytopia/linux-timemachine" MY_AUTH="cytopia" MY_MAIL="cytopia@everythingcli.org" -MY_VERS="0.5" +MY_VERS="0.6" MY_DATE="2020-03-29" # cmd [-r] [rsync opts] @@ -181,19 +181,17 @@ RSYNC_PARTIAL=".partial" # [resume] --partial-dir: Where to store unfinished files for resume # [atomic] ${BACKUP_INPROGRESS}: Tmp dest dir for atomic operations -if test -L "${DEST}/${BACKUP_LATEST}"; then - BTYPE="incremental" -else - BTYPE="full" -fi - -logmsg "Starting ${BTYPE} backup" -logmsg "\$ rsync $* ${SRC} ${DEST}/${BACKUP_INPROGRESS}" +BTYPE= # Only link destination if it already exists if test -L "${DEST}/${BACKUP_LATEST}"; then + BTYPE="incremental" + logmsg "Starting incremental backup" + logmsg "\$ rsync $* ${SRC} ${DEST}/${BACKUP_INPROGRESS}" + rsync \ --recursive \ + --times \ --delete \ --delete-excluded \ --partial-dir="${RSYNC_PARTIAL}" \ @@ -201,8 +199,13 @@ if test -L "${DEST}/${BACKUP_LATEST}"; then "$@" \ "${SRC}" "${DEST}/${BACKUP_INPROGRESS}" else + BTYPE="full" + logmsg "Starting full backup" + logmsg "\$ rsync $* ${SRC} ${DEST}/${BACKUP_INPROGRESS}" + rsync \ --recursive \ + --times \ --delete \ --delete-excluded \ --partial-dir="${RSYNC_PARTIAL}" \