A cron entry looks similar to the following:
In this case, the script "script.pl" would be run nightly at 3:30 AM.
30 3 * * * /usr/local/bin/nice -20 /bin/rm /usr/home/username/temp/*The "30 3 * * *" requires a bit more explaining. The time a cron command is executed is controlled by the 5 numbers that precede the cron directive.to remove all files from some temporary directory you might have each night at 3:30 AM, as in the earlier example. In this case the command remove (rm) is used. You can find where any command resides by typing this in telnet whereis command. This will give you the proper directory on your server.
The first number is the minutes after the hour (0-59).A * in place of any of the values matches all possibilities (for instance, in the given example the script runs every day because the *'s for day of the month, day of the week, and month of the year match all values).
The second is the hour of the day (0-23, with 0 being 12 AM).
The third number is the day of the month (1-31).
The fourth is the month of the year (1-12).
The fifth is the day of the week (0-6, with 0=Sunday and 6=Saturday, etc).
Multiple values are separated by commas. For instance, you might start with 15 1,3,5 * * * to run a script every day at 1:15, 3:15, and 5:15. (Note that our policies prohibit a program running via cron more often than once every two hours.)
Once you have your cron directive file (say, cron.file) in your account, you must connect via telnet and issue the command:
crontab cron.fileusing the name you gave the file. (Note that you must be in the same directory as the cron file at the time.) After this, your cron should be activated. If the programs running via cron generate errors, the cron daemon will e-mail them to your account.
If at any time you would like to change your cron jobs, just edit your file, and rerun the crontab command as shown above.