Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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:

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
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 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). –  Aleksandr Levchuk Mar 7 '11 at 15:58
add comment

Your Answer

 
discard

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.