i have a rman bash script which works when i execute it (./backup.sh). but when i use cronjob, it doesn't work. My scripts is as follows
backup.sh
rman target / @backup.rcv log=rman.log
backup.rcv
backup format '/backup/rman/backup/%U.arch.rman' filesperset 2 archivelog all delete input; backup format '/backup/rman/backup/%U.datafiles.rman' filesperset 2 incremental level 0 database; backup format '/backup/rman/backup/%U.arch.rman' filesperset 2 archivelog all delete input; backup format '/backup/rman/backup/%U.ctl.rman' current controlfile; delete noprompt obsolete;
my cronjob looks somthing like this
crontab -l
5 0 * * * /nas_backup/rman/svbo/backup/L0backup.sh >/dev/null 2>&1
i am very new to this rman and bash script so any help would be appreciated
inorder for this to be fixed replace the code in your "L0backup.sh" with
to get your ORACLE_SID and ORACLE_HOME you can echo it out like
next to set your crontab - lets say you want the above file to run every midnight (Crontab Guru)
#crontab -eif you notice your output gets loged to "rman.log".
furthermore you can now delete your "backup.rcv" file as its no longer being used.