#!/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/