diff options
Diffstat (limited to 'bin/bak-docs.sh')
-rwxr-xr-x | bin/bak-docs.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/bak-docs.sh b/bin/bak-docs.sh new file mode 100755 index 0000000..332ce6f --- /dev/null +++ b/bin/bak-docs.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# ---------------------------------------------------------------------- +# rotating-filesystem-snapshot utility +# essentially, rotate docbak-snapshots of /home +# on a weekly basis using rsync and cron +# ---------------------------------------------------------------------- + + +rm -rf /mnt/docbak/week.4 +mv /mnt/docbak/week.3 /mnt/docbak/week.4 +mv /mnt/docbak/week.2 /mnt/docbak/week.3 +mv /mnt/docbak/week.1 /mnt/docbak/week.2 +mv /mnt/docbak/week.0 /mnt/docbak/week.1 +rsync -avvz /mnt/storage/documents/ \ +--delete-after \ +--exclude-from '/home/lxf/.rsync-exclude' \ +--link-dest=/mnt/docbak/week.1 \ + /mnt/docbak/week.0/ |