Scheduled Backups of Home Directory
Matthew Kuiken
matt.kuiken at verizon.net
Mon Aug 7 05:22:10 UTC 2006
Gregory PiƱero wrote:
> I want to start running scheduled backups of my home directory. I
> have my eye on writing a bash script to mount my second hard drive
> (ext3 format) and then run rsync on /home.
>
> Here are the questions I'm having:
> 1. I'm thinking mount and maybe rsync of /home involve sudo.
> a. Is that true?
> b. How can I schedule/automate a script that needs root privledges?
>
> 2. Is there a way to tell the rsync command to exclude directories?
> a. It's no big deal if I can't, I'm just curious since I obviously
> don't care about the trash folders, etc.
>
> 3. What file changes detections method is best, checksum, time, or
> something else? I think these are options?
>
> Here's my bash script so far in hopes you'll have some feedback:
> sudo mount -t ext3 /dev/hdc1 /mnt/backup_drive/
> rsync -ac /home/ /mnt/backup_drive
>
> Much thanks in advance.
>
I got a lot of information on using rsync from this web site:
http://servers.linux.com/article.pl?sid=04/11/04/0346256&tid=119&tid=47&pagenum=2
It is mainly about using it over ssh, but has a lot of information on
how to use rsync and cp to create incremental backups on a rotating
basis, while using just a little more space than the drive it is backing
up. (Depending on the rate that your files change, it uses hard links
to keep files that didn't change from the last rotation without taking
up more disk space.)
I found it tremendously helpful in creating my backup strategy. If
you'd like my scripts for example as well, just let me know. The main
thing you'd need to change would be running mount/umount rather than
connecting to the networked file server.
-Matt
More information about the ubuntu-users
mailing list