Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the find command with the remove command

Status
Not open for further replies.

rahill13

Technical User
May 30, 2002
6
US
I am trying to use the find command to locate log and other dump files more than 90 days old and delete them, but the command is not working correctly.

***COMMAND***

#find /dump/spool -atime +90 -exec \ rm {} \;

***SAMPLE OF RESULTS****

find: 0652-083 Cannot execute rm:: A file or directory in the path name does not exist.
find: 0652-083 Cannot execute rm:: A file or directory in the path name does not exist.
find: 0652-083 Cannot execute rm:: A file or directory in the path name does not exist.
find: 0652-083 Cannot execute rm:: A file or directory in the path name does not exist.
find: 0652-083 Cannot execute rm:: A file or directory in the path name does not exist.
find: 0652-083 Cannot execute rm:: A file or directory in the path name does not exist.
find: 0652-083 Cannot execute rm:: A file or directory in the path name does not exist.
#


HELP!
 
Personally, I find this easier:

[tt]find /dump/spool -atime +90 | while read FN
do
rm ${FN}
done[/tt]

find's -exec syntax is annoying strange so I avoid it and use other methods that are more "generic"
 
Removing the \ fixed the problem.

Thanks alot,
Bobby Hill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top