Author Login
Post Reply
On Sun, 30 Mar 2008 15:48:54 -0400, Hal Martin wrote:
> You cannot use tar unless you create an exclude file, as it will copy
> the contents of /dev and /sys, which means the entire contents of RAM,
> and anything that is currently being generated by your devices will be
> copied as well.
>
> Personally, I would use either tar or rsync to do this, however, in
> saying that, I have never actually done this with a live system. This is
> the tar command I use for copying inactive systems, and it works quite
> well.
>
> (cd /mnt/source; tar cfpl - .) | (cd /mnt/dest; tar xfp -)
>
> I assume you could just generate an exclude file, and include that in
> the first command
You don't need an exclude file to avoid /dev and /sys because they are on
separate filesystems, so your use of -l takes care of this.
Rsync may work, or it may complain that files have changed between
building the list and copying them and you'd need to use -x to do the
same as -l with tar. Either way, shut down as many services as possible
during the copy, particularly anything that uses databases.
--
Neil Bothwick
If you got the words it does not mean you got the knowledge.

Attachment:
signature.asc (zipped)