summaryrefslogtreecommitdiff
path: root/daily-rsync.sh
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-06-15 15:58:59 -0500
committerluxagraf <sng@luxagraf.net>2023-06-15 15:58:59 -0500
commitab987e10f154f5536bb8fd936ae0966e909fa969 (patch)
tree9de5076f38b71ececb1bc94f8d9d19170898d603 /daily-rsync.sh
added all my scriptssynced/master
Diffstat (limited to 'daily-rsync.sh')
-rw-r--r--daily-rsync.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/daily-rsync.sh b/daily-rsync.sh
new file mode 100644
index 0000000..f594ef1
--- /dev/null
+++ b/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/