Ubuntu Terminal: How to Back up Your Crontab File CodeUnit 24 DEC 2010

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…

Related Posts:

About Craig Lotter

South African software architect and developer at Touchwork. Husband to a cupcake baker and father to two little girls. I don't have time for myself any more.