OpenVZ Forum


Home » Mailing lists » Users » Cloning and permissions
Re: Cloning and permissions [message #25215 is a reply to message #25212] Tue, 18 December 2007 00:54 Go to previous messageGo to previous message
Steve Wray is currently offline  Steve Wray
Messages: 18
Registered: August 2007
Junior Member
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.
 
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: Tue Aug 19 15:23:55 GMT 2025

Total time taken to generate the page: 0.11063 seconds