A Multiplatform Backup Solution with rSync: Part 1
A long time ago I used to be very good at making regular backups of my system. It was a very manual process – I didn’t use any software. I simply kept my files in a few places and periodically synced the folders up with a second computer. It worked well but I have a lot more than a few megabytes of data now, and more than one computer with data to backup.
For my personal computer, I have used file sync tools like SyncBack to maintain a mirror of my documents on an external hard drive. However, with a web server and other computers in my network a more centralized approach became very appealing.
Having a spare computer lying around and enough money to invest in a pair of hard drives I set out to give an old PC a new purpose in life – to become my network’s dedicated backup server. I didn’t want to have to maintain scheduling policies on each machine (what a pain) so I also wanted my server to be able to pull backups directly from each computer in my network. Additionally, I wanted to keep the option of setting up the backup server in a remote location to further protect my data – so Samba was something I wanted to avoid, if possible.
At first I was drawn to a project called RESTORE which is an easy to get rolling multiplatform backup system built on Xubuntu. I had difficulty getting it to backup a Windows system, however. SFTP to a Windows machine seemed to be broken and Windows share connections was not reliable. And again, I preferred to stay away from Windows shares anyhow.
So I turned my attention to an old tool in the *nix world known as rSync. My friend at Benford Does Stuff pointed me to the tool. He setup a backup server that used rSync to mirror a web server we used to maintain at our University. After sending me to a pair of HowTo guides I was well on my way to scripting my own incremental snapshot backup of my web server.
You may find the guides below
The above solution works great and I am using exactly that to snapshot my web server running Ubuntu Server 8.04.
With some minor tweaking the above script will snapshot a Windows-based computer decently. In particular, however, the script falls short when attempting to backup files that are currently open by the user or operating system. Open files on a Windows system are locked and cannot be read by other applications. There is a resolution but instructions and examples are rare, and I spent a considerable amount of time getting it working right in my setup. In my next article I will detail the modifications I made to Stephan Jau’s incremental snapshot script to mirror my windows systems.