diff options
Diffstat (limited to 'bin/daily-rsync.sh')
-rw-r--r-- | bin/daily-rsync.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/daily-rsync.sh b/bin/daily-rsync.sh new file mode 100644 index 0000000..f594ef1 --- /dev/null +++ b/bin/daily-rsync.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# ---------------------------------------------------------------------- +# rotating-filesystem-snapshot utility +# essentially, rotate backup-snapshots of /home +# on a weekly basis using rsync and cron +# ---------------------------------------------------------------------- + + +rm -rf /Volumes/MiniRSync/daily.4 +mv /Volumes/MiniRSync/daily.3 /Volumes/MiniRSync/daily.4 +mv /Volumes/MiniRSync/daily.2 /Volumes/MiniRSync/daily.3 +mv /Volumes/MiniRSync/daily.1 /Volumes/MiniRSync/daily.2 +mv /Volumes/MiniRSync/daily.0 /Volumes/MiniRSync/daily.1 + +rsync -avvz \ +--delete-after \ +--exclude-from '/Users/sng/.rsync-exclude-daily' \ +--link-dest=/Volumes/MiniRSync/daily.1 \ +/Users/sng/ /Volumes/MiniRSync/daily.0/ |