Rsync and incremental backups concept
Rsync originated as a replacement for rcp and scp.
Rsync can:
Rsync can sync two distinct folders:
-
locally (two folders on the same machine)
-
remotely (for instance : server to backup server).
Alternative to rsync
You can use Grsync (graphical interface) to create synchronization you need.
It is easy to set the location for Rsync on local machine. For the remote machine the syntax is this:
Two ways to call rsync
The simple way to use Rsync would be this:
rsync -a source/ destination/
or this (for the remote machine):
rsync -avz source/ [email protected]:/destination
(z stands for zipping included)
By default the files are not deleted at destination so –delete option is very important
rsync -a --delete source/ destination/
Incremental backups
Making a full copy of a large system can be a time-consuming and io-expensive process, it is common to make full backups only once a week or once a month. The other days you can create increments and store changes per each day.
These are called “incremental” backups achieved with rsync -b
option.
Rsync will not copy all files every single time a backup is performed.
It will only copy the files that have been newly created or modified since the last backup.
Be lazy: use cron
Run backup as cron job periodically. Create basic shell script that runs rsync and set that script into /etc/cron.daily
or /etc/cron.weekly
.
[googleres text=”rsync incremental backups”]
…
tags: & category: -