Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RMAN script is not running with crontab

3600940Feb 8 2018 — edited Feb 19 2018

Hi,

I created below rman script using crontab but I'm unable to execute cron job. I mean why its not running?

[oracle@ggsrv1 ~]$ cat rman_backup_full.sh

connect target /

run {

      delete noprompt obsolete;

      allocate channel d1 device type disk format '/u01/app/oracle/fast_recovery_area/%d_%u';

      backup

      incremental level 0

      database include current controlfile;

      backup archivelog all delete input;

    }

exit;

[oracle@ggsrv1 ~]$ cat run_rman_backup_full.sh

#!/bin/bash

RMANDATE='date +%d_%m_%Y'

WHEN='date +%d_%m_%Y-%H:%M:%S'

RMANLOGS="/u01/app/oracle/fast_recovery_area/DB1/rmanlogs"

ORACLE_BIN="/u01/app/oracle/product/12.1.0/db_1/bin"

ORACLE_SID="DB1"

echo "Backup operation begins.. " $WHEN

. ~/.bash_profile

$ORACLE_BIN/rman cmdfile /home/oracle/rman_backup_full.sh log $RMANLOGS/rman_backup_full_$RMANDATE.log WHEN='date +%d_%m_%Y-%H:%M:%S'

echo "RMAN Backup operation ends.. " $WHEN

[oracle@ggsrv1 ~]$ crontab -l

26 02 * * * /home/oracle/run_rman_backup_full.sh > /u01/app/oracle/fast_recovery_area/DB1/rmanlogs/rman_script.log

This post has been answered by EdStevens on Feb 17 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 17 2018
Added on Feb 8 2018
14 comments
4,015 views