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.
Related posts:
- Setting up and using NFS on Ubuntu
Network File System, NFS, has been around since Noah first networked his ark. Setting up... - Active Directory DHCP Authorisation Issues
So you just deleted a DHCP server in your Active Directory site and can't authorise... - Cleaning up Deleted Items Automatically from Exchange
Do you want to automatically delete Deleted Items in Outlook/Exchange or delete any type of... - Permanently mount a Windows share in Linux
Sick of manually mounting a Windows share on Linux with "mount" for it to drop... - NTLM Authentication (Active Directory) on Apache (Linux)
Here is a quick guide to enabling NTLM authentication for Apache 2. I generally use...
May 17th, 2010 - 14:35
Its one of those incredibly old, under rated and under used tools that come with pretty much all Linux distros.