TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

1 点作者 sankalp_sans大约 8 年前
I&#x27;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.<p>For version controlling cron jobs scheduled on our &quot;jobs servers&quot;, I wrote another job that dumps all the cron entries periodically to a git repo using `crontab -l &gt; &#x2F;path&#x2F;to&#x2F;backup; git commit; git push`<p>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?

1 comment

db48x大约 8 年前
Use systemd timers, and keep all of &#x2F;etc in a repository. Or put all the cronjobs or systemd timers (or whatever) into a configuration management system, and check that into version control.