Skip to content

Commit

Permalink
Fixes #28 Fixes #30 Make it actually incremental
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Mar 29, 2020
1 parent dc7fd26 commit 0ced736
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
21 changes: 12 additions & 9 deletions timemachine
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]"
MY_VERS="0.5"
MY_VERS="0.6"
MY_DATE="2020-03-29"

# cmd [-r] <src> <dst> [rsync opts]
Expand Down Expand Up @@ -181,28 +181,31 @@ 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}" \
--link-dest="../${BACKUP_LATEST}" \
"$@" \
"${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}" \
Expand Down

0 comments on commit 0ced736

Please sign in to comment.