rsync is an open source utility that provides fast incremental file transfer.
# pacman -S rsync
As a cp alternative
rsync can readily be used as an advanced cp alternative, specially useful for copying larger files:
$ rsync -P src dest
As a backup utility
The rsync protocol can easily be used for backups, only transferring files that have changed since the last backup. This section describes a very simple scheduled backup script using rsync, typically used for copying to removable media. For a more thorough example, see Full system backup with rsync.
For the sake of this example, the script is created in the Template:Filename directory, and will be run on a daily basis if a cron daemon is installed and properly configured. Configuring and using cron is outside the scope of this article.
First, create a script containing the appropriate command options: Template:File
- indicates that files should be archived, meaning that all of their attributes are preserved
- means files deleted on the source are to be deleted on the backup aswell
Here, Template:Filename should to be changed to what needs to be backed-up (Template:Filename, for example) and Template:Filename is where the backup should be saved (Template:Filename, for instance).
Automated backup with SSH
- tells rsync to use SSH
- is the user on the host Template:Codeline
Finally, the script must be executable:
# chmod +x /etc/cron.daily/rsync.backup