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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rm with date range & exception 1

Status
Not open for further replies.

gatetec

MIS
Mar 22, 2007
420
US
temp files are filing up /temp so quickly, and I want to remove all files under /temp with a cron job 1) if there are older than 1 day and 2) if their prefixes are not cmb*

pls advise.

thx much


 
make sure the find command is the way you want it before executing the remove:

Code:
# untested
find /temp -type f ! -name "cmb*" -atime +1 -print|xargs rm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top