Scheduled Backups of Home Directory

Alexander Skwar listen at alexander.skwar.name
Mon Aug 7 06:11:35 UTC 2006


· Gregory Piñero <gregpinero at gmail.com>:

> 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.

I'd suggest to use rsnapshot, which uses rsync 

> Here are the questions I'm having:
> 1. I'm thinking mount and maybe rsync of /home involve sudo.
> a. Is that true?

Yes.

> b. How can I schedule/automate a script that needs root privledges?

Use the crontab from user root. Alternatively, modify the /etc/fstab,
so that it includes "users" in the line for your 2nd hard drive.

> 2. Is there a way to tell the rsync command to exclude directories?

Yes. See the manual. Always see the manual.

> 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

Dump the script and use rsnapshot. Check out the home page
to see why it's so great.

Alexander Skwar
-- 
Abhängigkeit ist heiser, wagt nicht, laut zu reden.
(en) Bondage is hoarse and may not speak aloud.
                -- William Shakespeare (Romeo und Julia)






More information about the ubuntu-users mailing list