December 5, 2004

Crontab an old friend

Its been a while, but this week I had an opportunity for a refresher course in cron and aix (on the job learning of course). For those of you who are unfamiliar, cron is the scheduling utility in UNIX.

So to edit crontab, the command is crontab -e
To list crontab, the command is crontab -l
To view the job status of cron, the command is crontab -v
To remove the crontab file for your user, the command is crontab -r

The format on aix is as follows

  • The minute the job is to be run (0-59)

  • The hour the job is to be run (0-23)

  • The day of the month the job is to be run (1-31)

  • The month the job is suppose to be run (1-12)

  • The day of the week for the job. (0 - 6 respectively equates to Sunday through Saturday)

  • The shell command

For for midnight during the weekdays, and example would be
0 0 * * 1-5 /shellcommand.sh

An astrick (*) equates to all values, e.g., every hour, every day, every month, etc.

A pound sign (#) comments out the line.

To list who can access your cron file, /var/adm/cron/cron.allow file, and to deny access, /var/adm/cron/cron.deny.

Also to view all processes on a machine running the command is ps -elf.

Posted by Elyse at December 5, 2004 12:23 PM | TrackBack
Comments
Post a comment









Remember personal info?