kieranbarnes do you know where your towel is?

Using rsync to maintain backups on Linux

Posted on April 22, 2008

Following on from my previous article, regarding Setting up and using NFS on Ubuntu, here's how I keep backups for quite a few clients.

On a particular site I maintain a single backup server that several clients backup to on a nightly basis.

rsync is great. Its one of those incredibly old, under rated and under used tools that come with pretty much all Linux distros.

The following rsync command takes a backup of a directory on a server and backs it up to another whilst keeping a backup of orphaned/deleted files over NFS.

rsync -ahvz --exclude=*.log --backup
--backup-dir=<DESTINATION SERVER SHARE>`hostname`/orphans-`date +%Y-%m-%d`
--delete --delete-excluded <DIRECTORY TO BACKUP>
/<DESTINATION SERVER>`hostname`<DIRECTORY NAME>

Simple as.

Note: Remember to clean up your orphaned files on a weekly/regular basis or your hard drive will soon fill up.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Related posts:

  1. Setting up and using NFS on Ubuntu
    Network File System, NFS, has been around since Noah first networked his ark. Setting up...
  2. Active Directory DHCP Authorisation Issues
    So you just deleted a DHCP server in your Active Directory site and can't authorise...
  3. Cleaning up Deleted Items Automatically from Exchange
    Do you want to automatically delete Deleted Items in Outlook/Exchange or delete any type of...
  4. Permanently mount a Windows share in Linux
    Sick of manually mounting a Windows share on Linux with "mount" for it to drop...
  5. NTLM Authentication (Active Directory) on Apache (Linux)
    Here is a quick guide to enabling NTLM authentication for Apache 2. I generally use...

What this article useful to you?



Let me know, buy me a beer!
Alternatively, if you're feeling impecunious, you may like to subscribe to my RSS feed, or see other articles in the Linux category.

Filed under: Linux Leave a comment
Comments (1) Trackbacks (1)
  1. Its one of those incredibly old, under rated and under used tools that come with pretty much all Linux distros.


Leave a comment