backup.sh/README.md

17 lines
692 B
Markdown
Raw Normal View History

2024-08-14 19:52:14 -04:00
# backup.sh
2024-08-14 20:00:40 -04:00
Create incrimental backups using rsync and filesystem hardlinking.
requires: rsync, cron and a filesystem that is capable of hardlinking.
2024-08-14 19:52:14 -04:00
### Usage
```bash
./backup.sh <source dir> <destination dir>/<frequency> <number of backups to keep>
```
Setup backup strategy in `crontab -e`
```bash
2024-08-14 20:09:22 -04:00
@daily /mnt/DOOM/BACKUPS/backup.sh /home/bob/ /mnt/DOOM/BACKUPS/bob/daily 7 | tee -a /mnt/DOOM/BACKUPS/bob/log.txt
@weekly /mnt/DOOM/BACKUPS/backup.sh /home/bob/ /mnt/DOOM/BACKUPS/bob/weekly 4 | tee -a /mnt/DOOM/BACKUPS/bob/log.txt
@monthly /mnt/DOOM/BACKUPS/backup.sh /home/bob/ /mnt/DOOM/BACKUPS/bob/monthly 12 | tee -a /mnt/DOOM/BACKUPS/bob/log.txt
2024-08-14 19:52:14 -04:00
```