1
0
Fork
You've already forked rsync-backup
0
script for incremental backups over SSH using rsync and hard links
  • Shell 100%
2025年04月19日 12:37:49 +02:00
config Add local mode 2025年04月18日 16:01:51 +02:00
backup.sh Show current speed, but less verbose (omit file names) 2025年04月19日 12:37:49 +02:00
cleanup.sh Add local mode 2025年04月18日 16:01:51 +02:00
LICENSE Update LICENSE 2024年08月07日 00:09:43 +00:00
readme.md Add local mode 2025年04月18日 16:01:51 +02:00

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_exlude list.

    By default .ssh in 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.