Live data from Hacker News

Ask HN: How many of us here use cron jobs, and how do you version control them?

news.ycombinator.com

1–2 of 2 posts

Ask HN: How many of us here use cron jobs, and how do you version control them?

#1
I'm that guy in my team who obsessively version controls everything. Every config, every byte of change on any system has to go through a version control.

For version controlling cron jobs scheduled on our "jobs servers", I wrote another job that dumps all the cron entries periodically to a git repo using `crontab -l > /path/to/backup; git commit; git push`

This seems a bit hacky, but it works. This one time, one of the people in our team did a `crontab -r` instead of a `crontab -e` and we could get back the entire set of cron entries within seconds, thanks to the periodic backups. Any better solutions that come to mind? Maybe something too obvious?