Friday 27 September 2013

Desktop Backup Using Rsync

Backing Up Over SSH Using Rsync

This article will look at our workstation backup solution which uses rsync for keeping our home directories in sync with a directory on a NAS over SSH.

Its not a smart backup or anything just uses rsync to synchronise our home directories and any working directories, adding any new files and removing any that have been deleted.

Our workstations are the source and the NAS is the destination so if anything goes wrong with our systems we can just rsync them backup and use our installed package list to restore our workstation with minimal interaction.


Image of two squares one gree the other purple with the word rsync
rsync


Doing the Backup

For the command to do the work its just a simple one liner to instruct rsync what to backup and to were and passing any command arguments to control options.
chris@chic:~# rsync -avz --delete /home/chris chris@192.168.0.123:/home/Private/Backup

The above command uses the -a switch for making an archive the -v makes the program more verbose -z compresses and finally the --delete removes any files from the destination which were deleted from the source.

Using this will keep the two directories in complete sync but also will not keep any files which have been deleted from the source which is what we require.

You can get more information about rsync and its command arguments by reading the man page which is here or just run man rsync from a shell prompt.

Conclusion

As you can see from this article keeping two directories in sync using rsync is a very simple task and can provide a "casual" backup solution for desktops or workstations.

On a side note our new Reddit and Google+ social media pages are doing well and we have been seeing some referrals from these to our website so we hope to build upon this and improve our offerings and community.

No comments:

Post a Comment