quick easy backups on linux

Wednesday 23rd January 2008 10:45 PM

TAGS: linux, backups

There are a lot of backup options out there for linux, and everyone seems to want to roll their own, which is understandable when there are just so many different environments and setups.

I have a fairly large database of photos, which I really needed to keep backed up, but obviously this will work on any type of file.

First things first, I suggest backing up to an external USB drive, I simply used a spare 250gb drive, and a USB caddy for it, linux automatically detected it, and I was able to mount it from /dev/sda1straight away. Now, for the backup itself, this is stupidly simple, and for simple home use - absolutely perfect for me.

I simply setup a cronjob that copies from my local photo directory, to my USB drive, it's a one-liner which does the following things:

  • Copies recursively
  • Preserves timestamps and ownership permissions
  • Backs up "incrementally" - i.e. it doesn't copy your whole directory each time, only files that are changed.
  • Preserves links

cp -au /path/to/photos/ /mnt/backup/

I simply saved this file in the cron.daily folder, and gave it the permissions 755. Now I feel a bit safer with an extra copy. If your drive is permanently attached to your computer, don't forget to add an entry into /etc/fstab so it mounts each bootup!

Comments on this article:


I love feedback and comments, be the first!

Add Comment:


Make a Comment

*Nb, all comments are moderated to prevent spam or inappropriate content.








netforge logo
netforge provides high quality and friendly website design services to business. We're Australian based and reliable... (find out more).