OpenVZ Forum


Home » General » Support » Backup / Restore with rsync
Backup / Restore with rsync [message #50839] Thu, 14 November 2013 15:16 Go to next message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
Hello,

i have a script to backup all my containers.
rsync -avh --delete --log-file=rsync.log root@1.1.1.1:/vz/private/ /home/backup/1


On the openvz wiki page i was reading now that with rsync there is a need of suspend/resume. But i cant find information why this is so.
Quote:
openvz. org/Backup_of_a_running_container_with_vzdump
Use rsync and suspend/resume (minimal downtime)


I tested restoring and it works:
rm -rf /vz/private/100/*
rsync -av backupdir/100 /vz/private/100/
vzctl start 100 

Container starts and everything works good.

I saw only one problem:
chown / chmod is correct everywhere, but on /var/www it is www-data:tape instand of www-data:www-data.

Then i checked how the group id should be (on the container + at my rsync backup - on both the value is 33):
drwxr-xr-x 3 33 33 4.0K Jun 21 01:17 www

But after restoring it is:
drwxr-xr-x 3 33 26 4.0K Jun 21 01:17 www

Does somebody know why the groupid is not correct when the backup is restored?
Does somebody know why on rsync backup the container should get suspended?

Thanks a lot!
Re: Backup / Restore with rsync [message #50842 is a reply to message #50839] Thu, 14 November 2013 21:09 Go to previous messageGo to next message
pavel.odintsov is currently offline  pavel.odintsov
Messages: 24
Registered: February 2010
Junior Member
Hello, grep!

You can use rsync flag: --numeric-ids, it means: don't map uid/gid values by user/group name.


Re: Backup / Restore with rsync [message #50843 is a reply to message #50842] Thu, 14 November 2013 22:54 Go to previous message
grep is currently offline  grep
Messages: 34
Registered: November 2013
Member
Hi Pavel,

thanks for you awesome answer. I will try it and give report back. I think it must work Smile))

I have another answer. I checked out the ezvzdump script and saw that they make:
RSYNC_DEFAULT="rsync -ravH --delete-after --delete-excluded"

Is it a good idea to use the -H option? I am not sure but i think that the OS is using softlinks which is included in -a option.
But i think it doesnt hurt if i use -H to be sure everything is right?

Thanks!

Edit: --numeric-id has fixed it. Thanks so much!

[Updated on: Fri, 15 November 2013 02:27]

Report message to a moderator

Previous Topic: ksplice with debian wheezy ?
Next Topic: /usr/bin/vzdump: No such file or directory
Goto Forum:
  


Current Time: Thu May 02 01:39:36 GMT 2024

Total time taken to generate the page: 0.01755 seconds