summaryrefslogtreecommitdiff
path: root/bin/weekly-rsync.sh
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-02-16 15:57:40 -0500
committerluxagraf <sng@luxagraf.net>2020-02-16 15:57:40 -0500
commit2a9538f7711dcea71ba5702ca94a9d9c00287ea4 (patch)
treee0fe5ea7c909b01e10bf6a8dd4abcb619b6924c9 /bin/weekly-rsync.sh
parent3165ef5abdb298108efa2ba3d339f70ca966315a (diff)
added the rest of bin
Diffstat (limited to 'bin/weekly-rsync.sh')
-rwxr-xr-xbin/weekly-rsync.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/weekly-rsync.sh b/bin/weekly-rsync.sh
new file mode 100755
index 0000000..8dcdcf6
--- /dev/null
+++ b/bin/weekly-rsync.sh
@@ -0,0 +1,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/