970371 wrote:Where is your file 'rmanbkp.sh' located? You are telling cron it is located in /etc/cron.daily. While cron is certainly capable of locating and executing files in that directory, that is most definately NOT where you should be putting them. Please re-read DementeOTN's comment about placement of your scripts.
I have created a backupfile "rmanbkp.sh" and also edited in the cron file with the help of this comman
crontab -e , the script which i have written like:
20 9 * * * /etc/cron.daily/rmanbkp.sh (this is the backup file name, here backup output location not given because FRA is already set)
but it's not running, i think the path is wrong.
970371 wrote:And your "home location" is .. what? By default, it should be '/home/oracle'. Do not confuse the concept of the ORACLE_HOME location, with the 'home' directory of the os user 'oracle'. Two completely different concepts and should be two completely different locations.
then rmanbkp.sh i have to pur at home location.
BTW, while '/home/oracle/' is a far better location than '/etc/cron.daily' it's still not ideal. I'd put it in a subdirectory of either /home/oracle or (better) $ORACLE_BASE. Subdirectory names that make sense like 'bin' or 'scripts'., ie:
20 9 * * * /home/oracle/rmanbkp.sh
/home/oracle/scripts /home/oracle/bin /u01/app/oracle/scripts /u01/app/oracle/bin
Create a file, e.g.: backup_inc0 with the following contents:
su - oracle
Set appropriate privileges:
#!/bin/bash # File: /home/oracle/backup_inc0 # # Set up Oracle shell environment # ORACLE_SID=test ORAENV_ASK=NO source /usr/local/bin/oraenv -s # rman target / <<-EOF backup as compressed backupset incremental level 1 database \ plus archivelog delete input; exit EOF
Create the following Crontab entry to run the script every Sunday at 10 PM:
$ chown oracle:dba /home/oracle/backup_inc0 $ chmod u+x /home/oracle/backup_inc0
Enter the following:
$ crontab -e
I hope this information was useful.
0 22 * * 6 /home/oracle/backup_inc0