Steps:
(1) Create the script file bak_112.sh with the following content (automatically back up the database based on the current date ):
export ORACLE_BASE=/u01/app/=/u01/app/oracle/product/11.2.0/==$PATH:/bin:/usr/bin:/usr/sbin:/root:/opt/=$PATH:/opt/local/bin:$ORACLE_HOME/=$(date +%y%m%/h2i3L4v7@XXX full=y file=/u01/app/oracle/${D}.dmp log=/u01/app/oracle/${D}.log
Make sure this file can be executed,
chmod +x bak_112.sh
(2) generate the crontab file for oracle users in two ways:
1. log on with an oracle user, enter the command crontab-e, enter the edit window, enter the following content, and save it (bak_112.sh is automatically executed every 16: 10 ).
10 16 * * * /u01/app/oracle/bak_112.sh
2. log on with an oracle user/Var/spool/cron/crontabsRun the following command to create an oracle file:
crontab -l
Reference: http://docs.oracle.com/cd/E26926_01/html/E25812/enmwx.html#scrolltoc