Greetings-
Having some trouble with syntax for the "find" command. Using HP_UX 10.20.
I place a new directory "todaysdate" containing copied files in a specific directory "/db2/bkrpts" daily. This is done with the following script executed from crontab.
#Get the files, make the directory
/bin/cp -pR `find /tmp /users/download/XXX -type f -user osi -mtime 0` /db2/bkrpts/`date +"%m%d%ym`
This results in:
/db2/bkrpts/040202
/db2/bkrpts/040302
and so on....
I want to delete the directories and their contents after 25 days have passed. I do NOT want to delete the /db2/bkrpts directory. Ideally directory 04/02/02 and contents would be removed from /db2/bkrpts on 04/28/02.
This is what I have thus far. I tested with a test directory called 040302m:
find /db2/bkrpts/ -type d -name `??????m` -mtime +25 -exec rm -r {} \;
Unfortunately results in sh: 040302m: not found.
Sorry for what is likely a very mundane question. I would greatly appreciate any help offered.
Thanks,
-Michelle
Having some trouble with syntax for the "find" command. Using HP_UX 10.20.
I place a new directory "todaysdate" containing copied files in a specific directory "/db2/bkrpts" daily. This is done with the following script executed from crontab.
#Get the files, make the directory
/bin/cp -pR `find /tmp /users/download/XXX -type f -user osi -mtime 0` /db2/bkrpts/`date +"%m%d%ym`
This results in:
/db2/bkrpts/040202
/db2/bkrpts/040302
and so on....
I want to delete the directories and their contents after 25 days have passed. I do NOT want to delete the /db2/bkrpts directory. Ideally directory 04/02/02 and contents would be removed from /db2/bkrpts on 04/28/02.
This is what I have thus far. I tested with a test directory called 040302m:
find /db2/bkrpts/ -type d -name `??????m` -mtime +25 -exec rm -r {} \;
Unfortunately results in sh: 040302m: not found.
Sorry for what is likely a very mundane question. I would greatly appreciate any help offered.
Thanks,
-Michelle