summaryrefslogtreecommitdiff
path: root/bin/weekly-rsync.sh
blob: 8dcdcf60e57f67e8841abff054d4e72b242be075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# ----------------------------------------------------------------------
# rotating-filesystem-snapshot utility
# essentially, rotate backup-snapshots of /home 
# on a weekly basis using rsync and cron
# ----------------------------------------------------------------------


rm -rf /mnt/backup/week.6
mv /mnt/backup/week.5 /mnt/backup/week.6
mv /mnt/backup/week.4 /mnt/backup/week.5
mv /mnt/backup/week.3 /mnt/backup/week.4
mv /mnt/backup/week.2 /mnt/backup/week.3
mv /mnt/backup/week.1 /mnt/backup/week.2
mv /mnt/backup/week.0 /mnt/backup/week.1
rsync -avvz -K ~/ \
--copy-links \
--exclude-from '/home/lxf/.rsync-exclude-weekly' \
--link-dest=/mnt/backup/week.1 \
 /mnt/backup/week.0/