To generate a back up of a crontab file is actually pretty simple, making use of the built in -l switch that comes with the command:
sudo crontab -l > ~/path/to/your/backup/file
See what we did there? The -l switch spits out the crontab file’s contents and we simply pipe that into a file. Easy peasy. Note that sudo crontab and crontab are two different files, meaning you might want to backup both if you make use of the two different cron job files…
You might also enjoy:
-
The Linux Cron. An invaluable tool to do all those little jobs that you simply can't be bothered to remember to do.Essentially, the Linux Cron utility is a ...
-
A lot of the time, in order to quickly enable SSL for Apache in Ubuntu, servers make use of a self-signed certificates. These are pretty useful, though they ...
-
For example, let's say you currently do non-incremental backups of your data on a daily business. If you don't keep an eye on it, pretty soon your backup fo ...
-
If you work as a web developer with PHP and all of a sudden you need a script to do something specific for you on a system (say as a cron job or such), ther ...
-
If you are new to Linux then chances are high that the damn terminal and sudo command combination are not yet second nature to you, and as such you would mu ...