See How to jobs to schedule Oracle Jobs
#Save actual schedualtions: crontab -l > cron.txt Backup actual schedulation: cp -p cron.txt crontab_20040525.txt Edit: vi cron.txt Save: crontab cron.txt Check: crontab -l
Redirect the output The error to another file: ... 2>/tmp/error.log |
| Remember to set user variables in your scripts, because
crontab doesn't catch them automatically. Just copy them from $home/.profile and paste them after #!/bin/sh, for example: possible shells are: #!/bin/ksh #!/bin/bash #!/bin/sh #!/bin/ksh export ORACLE_SID=pvgg3 export ORACLE_BASE=/home/oracle export TNS_ADMIN=$ORACLE_BASE/admin/$ORACLE_SID/network/admin export ORACLE_HOME=$ORACLE_BASE/product/9.2.0.4 export PATH=$ORACLE_HOME/bin:$ORACLE_BASE/admin/scripts:$PATH export TMPDIR=/home/oracle/tmp export TMP=$TMPDIR export TMP_DIR=$TMPDIR SCRIPTFILE=script.sql cat << EOF > $SCRIPTFILE ....... |
Every hour of every day 00 0-23 * * * /home/oracle/admin/scripts/xp_take_stats.sh pvgg1 VPO > /home/oracle/admin/scripts/xp_take_stats.log At 02:00 AM on 03/07/2004 (dd/mm/yyyy) 00 02 03 07 * /home/oracle/admin/pvgg1/scripts/statsCaricamenti.sh > statsCaricamenti.out Every 5 minutes only 27/1/2005 and 28/1/2005 #Raccolta stataement per sqlreg 00,05,10,15,20,25,30,35,40,45,50,55 * 27,28 01 2005 At 00:00 each monday 00 * * * 1 Every day from monday to sat at 1 0 1 * * 0-6 Every day 02 4 * * * Every week 22 4 * * 0 |