LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 09-18-2010, 01:20 AM   #1
vzxen
Member
 
Registered: Jul 2010
Posts: 126

Rep: Reputation: 4
OpenVZ Container Backup


Hi,

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.

Regards
 
Old 09-18-2010, 01:34 AM   #2
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
you may need to use the exclude option to exclude /sys /dev

like this

tar cvzpf /path/to/backup.tar.gz --exclude=/vz/root/101/sys --exclude=/vz/root/101/dev /vz/root/101/*

c create archive
v verbose
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
 
Old 09-19-2010, 12:29 AM   #3
vzxen
Member
 
Registered: Jul 2010
Posts: 126

Original Poster
Rep: Reputation: 4
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.
 
Old 09-19-2010, 05:06 AM   #4
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
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.
 
Old 09-21-2010, 01:43 AM   #5
ashlyjay
Member
 
Registered: Dec 2006
Posts: 32

Rep: Reputation: 16
you can also use vzdump command to backup containers
 
Old 09-22-2010, 12:53 AM   #6
vzxen
Member
 
Registered: Jul 2010
Posts: 126

Original Poster
Rep: Reputation: 4
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 !
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reinstall OpenVZ Container OS vzxen Linux - Virtualization and Cloud 0 07-21-2010 01:23 PM
c++ container math otoomet Programming 1 04-13-2009 10:33 PM
Quota exceeded on CentOS 5.2 when creating OpenVZ container eager Linux - Software 1 03-25-2009 01:19 PM
PPTPclient in openVZ container laurens Linux - Newbie 0 03-24-2009 09:32 AM
Container l_leonard Solaris / OpenSolaris 2 05-30-2007 11:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 02:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration