Computing.Net > Forums > Unix > need help with auto file delete

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

need help with auto file delete

Reply to Message Icon

Name: j_hornung47
Date: August 24, 2006 at 16:51:46 Pacific
OS: unix
CPU/Ram: unix
Product: unix
Comment:

I have a ftp site, where I am using the following CRON scheduled script to delete all files in sub-directories that are older than 14 days. It works fine till now.

find . -mindepth 2 -mtime +14 -exec rm -rf {} \;

But, now I want it to do the same but ignore (not delete any files or sub-dirs) in a directory under the root called "IMP FILES". How do I enhance this command so it continues to delete the files older than 14 days on rest of the ftp but skip a particular folder.

Thnaks in advance.

JH




Sponsored Link
Ads by Google

Response Number 1
Name: nails
Date: August 24, 2006 at 21:11:19 Pacific
Reply:

Check out this miscellaneous tips link:

http://www.unixreview.com/documents/s=9602/sam0503web1/ur0503n.html

The first tip discusses several find implementations that ignore certain directories.


0
Reply to Message Icon

Related Posts

See More


Version control software Insert Date at the end of...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: need help with auto file delete

Need help with sorting a file www.computing.net/answers/unix/need-help-with-sorting-a-file/6971.html

I need help with my skript. www.computing.net/answers/unix/i-need-help-with-my-skript/5903.html

need help with finger command. www.computing.net/answers/unix/need-help-with-finger-command/4284.html