Open main menu

CDOT Wiki β

Changes

Lab 5 Warnings / Debrief

47 bytes added, 08:24, 8 July 2015
no edit summary
Here is the typical field layout for a crontab entry (or multiple entries):
.---------------- minute (0 - 59) <br>| .------------- hour (0 - 23)<br>| | .---------- day of month (1 - 31)<br>| | | .------- month (1 - 12) (or jan,feb,mar,apr ...) <br>| | | | .---- day of week (0 - 6) (Sunday=0 or 7) <br> | | | | | (or sun,mon,tue,wed,thu,fri,sat)<br>| | | | |<br>* * * * * command to be executed<br>
The asterisk (*) indicate to run for that unit of time. Below is an example of crontab entries:
The asterisks indicate to run for that unit of time. Below is an example of crontab entries:
  # Check every minute for logins by user “evil” '''* * * * * who | grep '^evil'''' # # Run a script called "ascript.bash" every odd hour (1,3 5...) during the week '''0 1,3,5,7,9,11,13,15,17,19,21,23 * * 1-5 /home/bob/ascript.bash''' # Run "ascript.bash" every half hour during the week '''0 */2 * * 1-5 /home/bob/ascript''' # Same... just doing it a different way '''0 */2 * * mon,tue,wed,thu,fri /home/bob/ascript'''
You will learn in the lab how to create and use the crontab utility to run a shell script automatically and periodically that will send an e-mail warning to the system administrator if disk space capacity has reached a level for immediate resolution.
13,420
edits