This page looks best with JavaScript enabled

Crontab Example

 ·  ☕ 1 min read

Background

For some reason, most distros now have a cron header that makes little sense to me, is way to verbose, and I constantly have to search online for the format or how to do what I need. For that reason, I came up with my own standard header which is concise yet has what I need.

Details

The following is my standard crontab format:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Minute (0-59) Hour (0-23) Day of Month (1-31) Month (1-12 or Jan-Dec) Day of Week (0-6 or Sun-Sat) Command
#   notice: append >/dev/null [e.g. Command >/dev/null] to discard standard output, only showing error output
#   notice: append >/dev/null 2>&1 [e.g. Command >/dev/null 2>&1] to discard all output
#   example: 0 0 * * * cleanup.sh >/dev/null   #run cleanup.sh every day at midnight.
# Mi Hr Dm Mo Wd Cm
# 00,15,30,45 * * * *  /home/drad/bin/net_dirs2 --mount >/dev/null

# always know your shell and user.
SHELL=/bin/bash
USER="userName"
Share on

drad
WRITTEN BY
drad
Sr. Consultant