Fundor333

Backup Your Crontab


Backup Your Crontab

2020-08-30 | dev coding dotfiles
Reading time 2 minutes | Word count 266 |

With covid I work sometime at home, sometime at office, allwayse with different computer.

This is one of the reason of my dotfile and, for some project I am working on, I need to have some cronjob in every computer but some cronjob is machine specific so I don’t need to sync all, only some.

So I contact the developer of DotBot1 and talk about it but it wasn’ t implemented so I make a plugin for this.

The plugin

Definition of needs:

  • Sync cronjob
  • Delete/update cronjob
  • Work only on the user’s cronjob
  • Only the bot’ cronjobs will be edited, not the others
  • Work with Crontab, I’m not interested in others cronjobs’ apps

So I use the command of crontab and make it works

How to use it

Like every plugin for dotbot you need to clone the plugin’s repo and add it to the script.2

After installation you can use the directive crontab for adding job to your crontab. In this way you can write multiple config for multiple type of intallations you have.

The direction will look like this

- crontab
	-cron: 0 * * * *
	 command: echo "Hello world"

For now this is a little thing working only on Crontab but I am thinking about adding Windows support but I don’t have any idea about how I make it, so if you have idea about Windows implementation comment in this post or open an issiue or a pull request on the repo


  1. The bot who manage my .dotfiles and other configs ↩︎

  2. The repo of the plugin has all the instruction about the installation ↩︎

Mentions and response

Respond to this post on your own site. If you do, send me a webmention here.

Find out more about webmentions on the IndieWeb.