Looking for VCS wrapper that tracks system files changing across the whole *nix OS and sends diffs through email

Posted by nextus on Server Fault See other posts from Server Fault or by nextus
Published on 2013-11-09T12:11:46Z Indexed on 2013/11/09 15:57 UTC
Read the original article Hit count: 107

Filed under:
|
|
|

I need some software that looks after custom directories across the whole OS (i.e. /etc) and alerting me if someone edit something file inside. Additionally, this tool must automatically commit and push changes into backup server, so I can easily determine when specific change in specific file was made. I'm using cvsbackup right now but I want to create or found something more modern.

I think using git as VCS is a great idea. I could have local repository and easily revert changes in my configuration files. Furthermore, pushing changes to the remote repository would helps me to recover my configuration files when the server is fault.

It doesn't seems difficult to write some wrapper around the git but there are a lot of problems. For example, I need to track custom directories: /usr/local/nginx/ and /etc/. So the destination point for my git repository is /. I don't need to track the other directories so I must to write overwhelming .gitignore rule:

*
!.gitignore

!/etc/
!etc/*

!/usr
/usr/*
!/usr/local
/usr/local/*
!/usr/local/nginx
!/usr/local/nginx/*

It's very daunting and prone to error. So it's maybe a good idea to create intermediate file that wrapper reads and converts to .gitignore format. Additionally, I don't want to keep my .git folder in / partition so I need to set appropriate GIT_DIR and GIT_WORK_TREE variables for git.

Is there any ready to use tools for implementation this task? I don't found any but I don't believe that no one needs this feature.

© Server Fault or respective owner

Related posts about linux

Related posts about freebsd