OpenVZ Forum


Home » Mailing lists » Users » Cloning and permissions
Re: Cloning and permissions [message #25212 is a reply to message #25210] Mon, 17 December 2007 23:16 Go to previous messageGo to previous message
Gregor Mosheh is currently offline  Gregor Mosheh
Messages: 62
Registered: April 2007
Member
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 - )

-- 
Gregor Mosheh / Greg Allensworth
System Administrator, HostGIS cartographic development & hosting services
http://www.HostGIS.com/

"Remember that no one cares if you can back up,
  only if you can restore." - AMANDA
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: VE fails to stop
Next Topic: ALERT! /dev/mapper/ubuntu-root does not exist
Goto Forum:
  


Current Time: Wed Aug 20 17:47:22 GMT 2025

Total time taken to generate the page: 0.09768 seconds