#!/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.4 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 ~/business/ \ --delete-after \ --exclude-from '/home/lxf/.rsync-exclude' \ --link-dest=/mnt/backup/week.1 \ /mnt/backup/week.0/