Question about Backing up with tar

Cameron Simpson cs at zip.com.au
Thu Dec 10 06:01:47 UTC 2009


On 10Dec2009 00:16, kevin <kevin at kevinslair.com> wrote:
| I would like to know if this will work with fc9:
| 
| # sudo su
| # cd /
| # tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found
| --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /
| 
| What I really want to know is this. I have two systems that are
| identical and would like to just copy one to the other and keep all
| permissions for each of the files and folders copied. Is this
| feasible or could someone point me to the right direction with some
| kind of tutorial?

I suggest rsync instead of tar. You can do stuff with tar like this:

  ssh master_system 'cd /; tar cf - .....' | ( cd /; tar xf - )

but it has several problems:

  - it will overwrite stuff, changed or not
  - it copies all the data over the link, changed or not
  - it won't delete stuff if the master_system has stuff removed

Rsync has a highly efficient algorithm that copies only changed data,
options for delete and an exclusion system somewhat more expressive than
tar's one.

Personally I recommend:
  - being more targeted: copy what needs to be the same only
    an highly inclusive copy such as yours risks damaging the second
    system if someone is making local changes
  - copy on a per-filesystem basis
    This really depends on your needs, which you need to spell out in
    more detail.
    The only time I've done what you're describing (copying everything)
    was on a system with a spare drive; I would copy the root, /var etc
    partitions to the spare drive. Each copy was only for its own
    filesystem, using rsync's -x option.
    That prevents walkig off into /home etc, which I didn't want to do.

See rsync's manual page. Read it a few times.
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Four lines good, eight lines bad.       - the signature farm




More information about the fedora-list mailing list