1

I want to backup my virtual machines (all Debian) with a cronjob. As the backups per machine can be pretty huge I only want to backup the system with its configuration itself (leaving out the directory where users mess around), which can be done with the exclude-dir-parameter.

I'm planning to run the cronjob once a week. But I really only want to backup the machine if something has changed in the system configuration or new packages have been installed. Is there a way to detect such changes in a virtual machine before running vzdump?

1 Answer 1

1

This can be done rather simply.

I version control all my containers with git.

You can start like this (everything is done on the head node):

apt-get install git-core
cd /srv/vz/private
git init

At this point you need to write a good .gitignore file:

vi .gitignore

My looks like this:

var
srv
tmp
home

Check to make sure you did not miss anything in your ignore list:

git status

To make a commit, do this:

git add .
git commit -a

To check if anything changed, run:

git status
3
  • Interesting approach, seems like a good idea. Thank you!
    – acme
    Mar 7, 2011 at 8:43
  • I've just started with git though - it is not a problem to have that many files versioned?
    – acme
    Mar 7, 2011 at 9:00
  • With git you can version Gigabytes with 10,000s of files - all operations (even merging) will complete in seconds. Here are some measurements that I did biocluster.ucr.edu/~alevchuk/git-test.txt - I predict that Git will scale to 100s of Gigabytes and 1,000,000s of files and the run times for all git operations will stay under 5 minutes on a decent storage (directly attached). Mar 7, 2011 at 15:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .