- Shell 100%
| config | Add local mode | |
| backup.sh | Show current speed, but less verbose (omit file names) | |
| cleanup.sh | Add local mode | |
| LICENSE | Update LICENSE | |
| readme.md | Add local mode | |
rsync-backup
A script intended to run as at regular intervals (e.g. as a cron job) to create an incremental backup over SSH (remote mode), or local storage (local mode).
It uses hard links to save storage space so only changed files are actually backed up on each run.
The latest backup version is linked to latest in the destination directory.
Configuration
The script uses a config directory: ${HOME}/.config/rsync-backup
In there it expects three files:
-
settings.env
Basic settings: ssh host, source directory, destination directory
-
backup_exclude
a list of files and directories to exclude from the backup
By default
Desktop,Downloads, and all hidden files/directories (beginning with a.) are excluded -
backup_include
Files and directories that should be included despite being excluded by the
backup_exludelist.By default
.sshin explcitly included in order to backup SSH keys, while other "dotfiles" are excluded.
Templates for the config files are included in this repository.
Cron job
In order to run the backup script every hour with a 30 minute offset from each other (recommended), add the following entry in crontab -e:
0 * * * * <location of the backup script, absolute path>
30 * * * * <location of the cleanup script, absolute path>
Don't forget to make both scripts executable, if they aren't already.