summaryrefslogtreecommitdiff
path: root/daily-rsync.sh
blob: f594ef18d249cb1a3719d5f34b1ce75e9aacfcff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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/