vi rmanfull.sh
!/bin/bash
source /etc/profile
DAY_TAG=date +"%Y-%m-%d"
week=date +%W
backdir1=/home/oracle/backup/"
backdir1
rman target / nocatalog msglog /home/oracle/backup/log/fullback_$DAY_TAG.log<
run{
crosscheck backup;
delete noprompt expired backup;
allocate channel d1 type disk;
allocate channel d1 type disk maxpiecesize = 3500M;
allocate channel d2 type disk maxpiecesize = 3500M;
backup incremental level 0 as compressed backupset database format '
backdir1/arch_%d_%T_%t_%s_%p' archivelog all;
backup current controlfile format '$backdir1/ctl_%d_%T_%t_%s_%p';
release channel d1;
release channel d2;
}
EOF
vi rmanincreme.sh
!/bin/bash
source /etc/profile
DAY_TAG=date +"%Y-%m-%d"
week=date +%W
backdir1=/home/oracle/backup/"
backdir1
rman target / nocatalog msglog /home/oracle/backup/log/incremental_$DAY_TAG.log<
run{
crosscheck backup;
delete noprompt expired backup;
allocate channel d1 type disk;
allocate channel d1 type disk maxpiecesize = 3500M;
allocate channel d2 type disk maxpiecesize = 3500M;
backup incremental level 1 as compressed backupset database format '
backdir1/arch_%d_%T_%t_%s_%p' archivelog all;
backup current controlfile format '$backdir1/ctl_%d_%T_%t_%s_%p';
release channel d1;
release channel d2;
}
EOF
crontab -e
0 4 * * 0 bash rmanfull.sh
0 4 * * 1-6 bash rmanincreme.sh