find with rm fails in script [message #532500] |
Wed, 23 November 2011 02:53 |
hristo
Messages: 258 Registered: May 2007
|
Senior Member |
|
|
Hi!
I have a script that flashes a database to a previous checkpoint. In the script I remove older files. But the code below fails:
! find /database/data/flash_recovery_area/database/autobackup -ctime +4 -exec rm -rf {} \;
! find /erpdev2/data/flash_recovery_area/database/flashback/*.flb -ctime +5 -exec rm {} \;
find: missing argument to `-exec'
find: missing argument to `-exec'
What argument is missing, I can run the commands on the terminal without any errors.
The complete script:
#----------------------------ENVIRONMENT-------------------------------#
. /etc/profile
. /home/oracle/.bash_profile
. /database/oracle/.database_profile
export ORACLE_SID=DATABASE
sqlplus -s '/ as sysdba' <<EOF
whenever sqlerror exit sql.sqlcode
shutdown immediate;
startup mount;
flashback database to restore point RP1;
alter database open resetlogs;
drop restore point RP1;
! find /database/data/flash_recovery_area/database/autobackup -ctime +4 -exec rm -rf {} \;
! find /database/data/flash_recovery_area/database/flashback/*.flb -ctime +5 -exec rm {} \;
create restore point RP1 guarantee flashback database;
The scipt finishes but throws the errors mentioned above.
Regards
H
[Updated on: Wed, 23 November 2011 02:54] Report message to a moderator
|
|
|
|
|