************************************************************************* * * * Original:blog.csdn.net/clark_xu Xu Changliang's Column************************************************************************
Rman Backup Script
#! /bin/bash
Su-oracle <<!
Rman Target/<<eof
Backup as compressed BACKUPSET Database
Include current controlfile format '/orabak/db_%d_%t_%s '
plus archivelog format '/orabak/arch_%d_%t_%s ' Delete allinput;
Delete NoPrompt obsolete;
Exit
Eof
Third backup save platform self-proactively cleans out outdated backup files
#! /bin/bash
For file in ' Ls/orabak '
Do
if [[${file:0:2} = = "db"]];then
Fdate=${file:10:8}
mydate= ' Date +%y%m%d-d '-7 day '
If [[$fdate < $mydate]];then
RM-RF $file;
Else
echo $file;
fi
Else
Fdate=${file:12:8}
mydate= ' Date +%y%m%d-d '-7 day '
If [[$fdate < $mydate]];then
RM-RF $file;
Else
echo $file;
fi
fi
Done
Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.
"BASH" proactively cleans up Rman script backup files