Crontab Files

| 1 Comment | No TrackBacks

Crontabs are incredibly useful devices - the easiest way to regularly run a command at a specified time. The unfortunate part is that, as an operating system level function, their content is easily lost if you aren't careful about backups, or haphazardly reinstall your Unix system. A simple trick I learned is to keep your crontab entries in a file, say, .crontab in your home directory, rather than just editing your crontab directly (i.e. crontab -e). That way, you can be sure that all your important data, including your own user crontab, is in your home directory, and that's the one important thing to backup. To install a new crontab, simply run crontab ~/.crontab after having edited that file and your cron system will install your changes.

No TrackBacks

TrackBack URL: http://dinomite.net/cgi-bin/mt/mt-tb.cgi/280

1 Comment

Good tip, it's been a pain figuring out when random things are running on my machine with the /etc/cron.d/ and cron.daily, cron.hourly, and such spreading files out all out over. Having a crontab file you can edit means it can be under source control in your home directory as well!

Leave a comment

Pages

About this Entry

This page contains a single entry by Drew Stephens published on April 8, 2009 11:20 PM.

Caligula's Giant Ship was the previous entry in this blog.

I'm on the Genius Engineering blog is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.