Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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:


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
share|improve this answer
Interesting approach, seems like a good idea. Thank you! – acme Mar 7 '11 at 8:43
I've just started with git though - it is not a problem to have that many files versioned? – acme Mar 7 '11 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 - 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). – Aleksandr Levchuk Mar 7 '11 at 15:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.