[CoLoCo] rsync
Jim Hutchinson
jim at ubuntu-rocks.org
Mon Mar 17 15:27:08 GMT 2008
I'm forwarding this to the whole list in case someone has a great solution.
Thanks.
On Mon, Mar 17, 2008 at 9:08 AM, David L. Willson <DLWillson at thegeek.nu>
wrote:
> On Sat, 15 Mar 2008 15:55:14 -0600, Jim Hutchinson wrote
> > David,
> >
> > You hinted a while back about helping me do an rsync script to do
> backups
> > and put it in as a cron job. Below is my attempt at a script. Will it do
> > what I think? Namely backup all files in my /home (including other users
> in
> > /home) to the separate hard drive. Also, how do I make it a cron job? I
> want
> > it to run daily. What happens if the computer is off when it's supposed
> to
> > run? Will it do it at next login or just skip it?
> >
> > # !/bin/bash
> > # backup script to run daily as a cron job
> > rsync --delete --backup -avz /home/ /media/sdb1/backup/
> >
> > Is there anything more fancy I should do? One script I saw made a
> different
> > folder for each day of the week. I'm not sure how that would be useful
> > though. I don't want to have to dig through 7 folders to find what I
> want to
> > recover - unless each folder would hold a full backup giving me 7 days
> to
> > fall back to previous versions if I delete something I didn't want to.
> > However, that would take a lot of space I think.
>
> If you'll be backing up to a hard-link capable filesystem, you should take
> advantage of
> it. You'll get a "full" backup every day but only give up the space
> needed for a
> "diff". You want to do something like this.
I'm not sure what this means but the backup drive in this case is a second
internal drive formated as ext3. I set up a /backup directory to hold the
backup(s). I ran my above command once already and it seemed to work but
it's a manual thing at the moment. I thought the -z option would archive the
backup which I thought meant compressing it but it seems uncompressed to me.
Did I get that wrong?
> whattoBackup=/home/jhutchinson
> yesterdaysBackup=/backups/2008-03-17
> todaysBackup=/backups/2008-03-18
> cp -al $yesterdaysBackup $todaysBackup
> rsync --archive --hard-links --delete --verbose $whattoBackup
> $todaysBackup
>
> Now, obviously the way I expressed it here is pretty error-prone, but it
> expresses the
> point. I have a couple 20-liners that do the job pretty well, but they're
> not pretty
> and they need root. I'm trying to carve time to pretty one up for use by
> a normal user
> with no priveleges.
>
> You should forward this to the CoLoCo group. I'm sure you're not the only
> person with
> that question.
>
Any additional help is appreciated and may be useful to others who are
looking for an easy and relatively comprehensive backup plan.
Thanks,
-jim
--
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-us-co/attachments/20080317/d8fb2102/attachment.htm
More information about the Ubuntu-us-co
mailing list