Databases Reference
In-Depth Information
Note how the date, month, and weekday entries are * , indicating that they do not matter; this should be
run every day.
To schedule it at 10:23 p.m. every Friday and Sunday, use this:
23 22 * * 5,7 rman.sh
To schedule it at 10:23 p.m. on March 10, use this:
23 22 10 03 * rman.sh
To schedule it at 10:23 p.m. on the 10th of each month, use this:
23 22 10 * * rman.sh
To schedule it at 10 minutes past every hour on Sunday, use this:
10 * * * 0 rman.sh
To schedule it every 15 minutes every day, use this:
0,15,30,45 * * * * rman.sh
How It Works
One of the problems of cron jobs is that they are executed in background, so any output from them does not go to the
screen. You must capture the output in some log file. To facilitate that, in the actual task name, you can use a notation
like this:
<command> > log.log 2>&1
This notation uses two special output streams, 1 and 2, for standard output and standard error, respectively.
The output of the command that generally goes to the screen is shown as standard output, and any error
messages go to standard error. Here the standard output is redirected by the > character to the file log.log. The
notation 2>&1 means that the output of standard error (denoted by 2) is being redirected to 1 (standard output),
which in turn goes to the file log.log too. So, this way, all the output from the <command > can be captured in the
file log.log.
Table 9-2 describes the fields of crontab entries in detail. Remember that fields are delimited from each other by
whitespace (space characters, tabs, and the like).
 
Search WWH ::




Custom Search