Gregor Mosheh wrote:
Peter Machell wrote:
vzctl stop xx
cp -R /vz/private/xx /vz/private/xxx
cp -R /etc/vz/conf/xx.conf /etc/vz/conf/xxx.conf
vzctl start xxx

To have cp preserve permissions, use the -p flag.

I use tar instead of cp, for situation like this. Tar, unlike cp, is smart enough to handle symbolic links, permissions, ownerships, and sparse files. Use this age-old Unix Jedi trick:

mkdir /home/vz/private/2
cd /home/vz/private/1
tar cf - * | ( cd ../2 ; tar xvf - )

That doesn't need a -p option? ie

 'tar xpvf'

I tend to use 'tar --numeric-owner -cf' as well, just in case.


_______________________________________________
Users mailing list
[email protected]
https://openvz.org/mailman/listinfo/users

Reply via email to