Crontab version control?

I have several dozen Linux machines running cron , and I would like to put crontabs in some version control system. For version control, I use Mercurial ( hg ), so it will be perfect, but if there is some other system that is better suited for this task, I would consider it.

One of the aspects that is characteristic of my situation is that all crontabs relate to the general user (and not to the real person, but to the entries β€œservices”). I would like the change history to include the actual author of each change, and not the special account where the cron jobs run.

+4
source share
3 answers

crontab -l flushes your crontab to standard output, which you can redirect to a file. You could have work (in cron, of course) to redirect it to a file, which is then different, and if necessary is pushed to the original control.

+2
source

http://joey.kitenet.net/code/etckeeper/ ?

From this site:

etckeeper is a set of tools that allows you to store / etc in the git, mercurial, darcs or bzr repository. It connects to apt (and other package managers, including yum and pacman-g2) to automatically make changes to / etc during package updates. It keeps track of metadata for files that revison control systems do not normally support, but this is important for / etc, for example, the permission of /etc/shadow . It is quite modular and customizable, and also easy to use if you understand the basics of working with version control.

+1
source

If a Linux system follows LFS (Linux File System Standard, IIRC), then / etc should contain only configuration files. I had pretty good experience importing all / etc into CVS.

The only problem is that only the root can fix the changes, so it was a little difficult to understand who broke something. This can be solved by assigning each administrator an abbreviated letter of 3 letters and setting the rule according to which each commit should begin with this name.

0
source

All Articles