1: #!/bin/sh
2: . /home/oracle/.bash_profile
3: . /usr/local/bin/oraenv << END
4: ORCL
5: END
6:
7: cd /home/oracle/scripts
8: logfile=/home/oracle/scripts/log/rman_ORCL_LVL0.log.`date '+%d%m%y'`
9:
10: rman target / nocatalog CMDFILE /home/oracle/scripts/rman_ORCL_LVL0.sql LOG $logfile
11: status=$?
12:
13: if [ $status -gt 0 ] ; then
14: mailx -s "[BACKUP][FAILED] ORCL LVL0" me@myemail.com <<!
15: `cat $logfile`
16: !
17: else
18: mailx -s "[BACKUP][SUCCESS] ORCL LVL0" me@myemail.com <<!
19: `cat $logfile`
20: !
21: fi
22:
23: echo "Backup files removed (4+ days OLD):"
24: echo `find /u03/backup/ORCL -mtime +4 -print`
25: find /u03/backup/ORCL -type f -mtime +4 -exec rm -f {} \;
26:
27: echo "Archive logs removed (2+ days OLD):"
28: echo `find /u03/archive/ORCL -mtime +2 -print`
29: find /u03/archive/ORCL -type f -mtime +2 -exec rm -f {} \;
No comments:
Post a Comment