# crontab -l
# crontab -e
0 0 * * * su - oracle /home/oracle/shell/delarchivelog.sh
mkdir /home/oracle/shell/
chown oracle:oinstall shell
# cat /home/oracle/shell/delarchivelog.sh
#!/bin/sh
#find /data/oracle/arch/ -type f -name "*.arc" -mtime +15 -delete
rman target / <<eof
run{
allocate channel c1 type disk;
crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt archivelog until time 'sysdate-14';
release channel c1;
}
exit;
eof
exit