Go to file
2024-08-14 17:00:40 -07:00
backup.sh fixed hashbang 2024-08-14 17:00:09 -07:00
README.md updated readme 2024-08-14 17:00:40 -07:00

backup.sh

Create incrimental backups using rsync and filesystem hardlinking.

requires: rsync, cron and a filesystem that is capable of hardlinking.

Usage

./backup.sh <source dir> <destination dir>/<frequency> <number of backups to keep>

Setup backup strategy in crontab -e

0  */3  *  *  *  /mnt/DOOM/BACKUPS/backup.sh  /home/bob/  /mnt/DOOM/BACKUPS/bob/daily    56  |  tee  -a  /mnt/DOOM/BACKUPS/bob/log.txt
0  0    *  *  4  /mnt/DOOM/BACKUPS/backup.sh  /home/bob/  /mnt/DOOM/BACKUPS/bob/weekly   4   |  tee  -a  /mnt/DOOM/BACKUPS/bob/log.txt
0  0    1  *  *  /mnt/DOOM/BACKUPS/backup.sh  /home/bob/  /mnt/DOOM/BACKUPS/bob/monthly  12  |  tee  -a  /mnt/DOOM/BACKUPS/bob/log.txt