OpenVZ Container Backup
Is it ok if I TAR the /vz/root/101/ directory ?
Will it be a valid backup ?
Also to restore I will need to stop the VPS and restore it in /vz/private/101 directory right ?
I dont want to stop the VPS while its running.
you may need to use the exclude option to exclude /sys /dev
tar cvzpf /path/to/backup.tar.gz --exclude=/vz/root/101/sys --exclude=/vz/root/101/dev /vz/root/101/*
c create archive
z filter through gunzip for compressing you can use j option for bzip
p tell tar to preserve files permissions
f your backup file /path/to/backup.tar.gz
--exclude tells tar to not backup these directories
It should backup with it still running. While restoring your backup you would have to shut your vps down
So its ok if we backup directly right ?
And what about the /proc files.
When I archieve in this method, there are errors of files size shrinking in the /proc files.
Yes it is. Sorry I forgot about /proc. Exclude it also. Just remember when you restore your backup, you will have to create the /proc, /dev, and /sys or any other file you may have excluded such as /mnt or /media.
you can also use vzdump command to backup containers
Whats the harm if I backup the /proc, /dev, and /sys directories as well ?
All these directories are virtual files and whenever the OS restarted they are made again right ? Correct me if I am wrong !
|All times are GMT -5. The time now is 08:08 PM.|