Mailinglist Archive: opensuse (3337 mails)

< Previous Next >
Re: [SLE] rsync syntax help
  • From: "Hylton Conacher(ZR1HPC)" <hylton@xxxxxxxxxxxxxx>
  • Date: Sat, 01 Apr 2006 22:10:35 +0200
  • Message-id: <442EDE3B.4090406@xxxxxxxxxxxxxx>
Ken Schneider wrote:
On Wed, 2006-03-29 at 18:04 +0200, Hylton Conacher(ZR1HPC) wrote:

I am looking into using rsync to make a copy of my existing home directory(1.6Gb) and storing an exact copy on another local drive.
....
<snip>
The command so far:
#rsync -vcrlAogt -stats /home/hylton /media/backup/


I would use rsync -varpltz --stats /home/hylton/ /media/backup/home

Make sure you include a closing / on the source so that you get a
recursive copy. I also doubt your home directory has any special ACL's
that need backup. This could also be used by the owner of the files
which in this case would be hylton.
Hi Ken,

Thanks for the input.

I am not sure about your thoughts on the / as the man page tells otherwise (A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning "copy the contents of this directory" as opposed to "copy the directory by name"....). I mainly did not put it there to avoid having to create a /media/backup/home/hylton directory as rsync would do it during its process.

To explain it it in more detail: I want the entire contents of /home/hylton/ to be rsynced to /media/backup so that if I browse the /media/backup/ directory I am only going to see a home directory. Entering /media/backup/home will only present me with the hylton directory and finally entering /media/backup/home/hylton will present me with all the files, directories and subdirectories as they are laid out in my 'real' /home/hylton/ ie an EXACT replica.

I have noted the differences that concern me between the options you and I have selected and comment below.

As the only user on the system I agree to not storing the ACL's however for mirroring could it be added?

Why would you not include the c option? Surely if the file on the source and destination have the same checksum and are therefore not transferred, it would speed up the total transfer? This is discussed in the 'Description' paragraph on the man page.
I would like the copy on the original and backup to be identical so as to be up and running as quickly as possible.

As I will be doing the rsync as root I would have thought that preserving the owner and group would be important. I noticed with a cp of the files that the ownership all reverts to root. I see that the inclusion of the p switch covers both o and g, thank you.

As a drop in backup image of the /home/hylton directory I would like the file times to be kept the same as when the file was created/edited, not when it was copied. Would leaving out the -t option make the times on the files change to when the rsync was run?

I see you have added the z option to compress the files. I would prefer to not compress the files as in doing so would defeat the PnP ability of the backup I was making. I have sufficient disk space for the backup and so will use it. With the current switch configuration, if the the situation should arise that I need to restore the backup by switching the source and dest labels, I see there is no switch to decompress the file on returning it to its 'original' location.

I'll cover the restoration of an rsync cp in a new thread.

Tnx for the extra input
--
========================================================================
Hylton Conacher - Linux user # 229959 at http://counter.li.org
Currently using SuSE 9.2 Professional with KDE
========================================================================


< Previous Next >