2

Many developers maintain a dotfile repository, keeping all their configurations in a single space that can be easily synced among different machines. What I haven't seen so far is people maintaining their crontabs in the dotfile repository.

Regardless if you find the idea itself useful or not, what would be a convenient way to manage one's crontab in the dotfile repository as well? In my dotfiles repository, the management of the symlinks is handled by GNU Stow and a simple Makefile that wraps the stow-commands like so:

all:
    stow --verbose --target=$$HOME --restow */

delete:
    stow --verbose --target=$$HOME --delete */

GNU Stow obviously will not work for crontabs. How could I integrate the rollout, update and removal of a crontab in this setup?

Bastian Venthur
  • 12,515
  • 5
  • 44
  • 78
  • When creating a new tag it's always appreciated if you also add a [guidance](https://stackoverflow.com/tags/stow/info) and preferably, a description. – Gert Arnold Feb 11 '22 at 18:00
  • I don't have tag wiki edit privileges yet, and when submitting a proposal, the edit queue is always full, unfortunately. – Bastian Venthur Feb 11 '22 at 21:24

1 Answers1

4

crontab has a usage of the form:

crontab [-u user] file

which will install a new crontab from some named file. You can place this step in your Makefile and install a file committed to the repository.