[GRLUG] mirroring function

Bob Kline bob.kline at gmail.com
Mon Aug 29 17:27:54 EDT 2011


On Mon, Aug 29, 2011 at 2:00 PM, Dan Pilcheck <pilcheck at gmail.com> wrote:

> On Mon, Aug 29, 2011 at 1:38 PM, Bob Kline <bob.kline at gmail.com> wrote:
> > I have a USB backup drive, which I only
> > turn on when I want to back up my system.
> > And I only do that now and then for time
> > reasons - even on a USB 2 connection it
> > takes a couple of hours for a full backup.
> > So what I like to do is incremental backups.
> > The way I do that now is simply to mount the
> > drive and run "cp -Rpu . /drive/directory" from
> > the top of the directory area that I want to
> > back up.
> > This works fine except that the "u" option
> > ensures that anything on the primary drive
> > not on the backup drive is copied over, but things
> > that are not on the primary drive, and are on
> > the backup drive, do not get erased, which is
> > what I want.  I've read the man page, and
> > there does not seem to be an option for doing
> > this.
> > What I'm really looking for is a mirroring
> > function, but only on a now and then basis,
> > not having two drives running all the time.
> > Suggestions?  I hear that rsync does something
> > like this.  Can it do this locally, between two
> > drives?  i.e., I don't need the "remote" part.
> >   -- Bob
> >
> > --
> > This message has been scanned for viruses and
> > dangerous content by MailScanner, and is
> > believed to be clean.
> > _______________________________________________
> > grlug mailing list
> > grlug at grlug.org
> > http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug
> >
>
> Bob,
> If I run rsync with something similar in mind, I'd check out
> "rsync -vazpHEK"  - verbose, archive, compress...
> -K, --keep-dirlinks   treat symlinked dir on receiver as dir
> -E, --executability   preserve executability
> -H, --hard-links   preserve hard links
>
> -o -g -X -u might be of use too!
>
> Hope that helps
> --
> Who is to say that the next step in evolution is not a statistical
> chance but rather a by-product of our own will?
> That from here on out, nature stops deciding who survives and who
> doesn't, but our own decisions?
>

Right on!  I actually used "rsync --delete -avHEK  /dir1/ /dir2",
where /dir1/ is the directory area to be copied, and /dir2 is the
mounted backup drive, set to the desired directory area.
--delete gets rid of files no longer on /dir1/.  It appears that
the -a option includes -p.

The end result is a mirror, done by hand.  Just what I wanted.

Thanks.

    -- Bob

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shinobu.grlug.org/pipermail/grlug/attachments/20110829/97d0a906/attachment-0001.html>


More information about the grlug mailing list