Make your crontab more user friendly!

All you *nix users out there are probably just like me. You use cron a lot, and for some mighty important things. However, you just don’t quite use it enough to keep the exact order of the values for when to kick off a job in your head. Well, for me, an easy way to help that is to put what I call headers into your crontab. These are in fact comments, but they spell out what to put where and act as a reference so you can get back to getting work done, instead of googling for the information! Check it out:


# minute (0-59),
# | hour (0-23),
# | | day of the month (1-31),
# | | | month of the year (1-12),
# | | | | day of the week (0-6 with 0=Sunday).
# / | | | | commands
3 2 * * 0,6 /some/command/to/run
3 2 * * 1-5 /another/command/to/run

How’s that? Pretty nifty, huh? Be sure to take out the last two lines that I stuck there for examples.

Enjoy!

2 thoughts on “Make your crontab more user friendly!

  1. I cannot tell you how many times I had to google for that exact information when I was making crontab changes. It’s these little hints and tips like this that really make this website a valuable resource. Right on!!!!

  2. Pingback: crontab at mts/blog

Tell me what you are thinking?