UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 11th, 2004, 03:38 AM
webstyler webstyler is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 66 webstyler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 59 m 4 sec
Reputation Power: 6
Simple Cron job

I need delete all dir in client_download create or modified more than 5 minutes ago

I use this cron :

find /home/mysite/public_html/client_download -type d -cmin +5 -exec rm -f {} \;

But Cron send me the message :

rm: cannot remove `/home/mysite/public_html/client_download': Is a directory
rm: cannot remove `/home/flextic/public_html/mysite/7pN4VU9qlf1jSdFdtWy8': Is a directory
rm: cannot remove `/home/flextic/public_html/mysite/XSZ31ZS82E': Is a directory


???

Reply With Quote
  #2  
Old February 11th, 2004, 05:50 AM
druuna druuna is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 137 druuna User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 37 sec
Reputation Power: 0
Change this:

rm -f
to
rm -rf

Hope this helps.

Reply With Quote
  #3  
Old February 11th, 2004, 07:29 AM
webstyler webstyler is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 66 webstyler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 59 m 4 sec
Reputation Power: 6
Quote:
Originally posted by druuna
Change this:

rm -f
to
rm -rf

Hope this helps.


perfect

but .. why this ?

thks a lot

Reply With Quote
  #4  
Old February 11th, 2004, 12:30 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
because "rm" doesn't remove directories by default... check out "man rm"

hth,
M.
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #5  
Old February 11th, 2004, 01:30 PM
webstyler webstyler is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 66 webstyler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 59 m 4 sec
Reputation Power: 6
Unhappy



new problem

the final is this

find /home/mysite/public_html/client_download/ -type d -cmin +20 -exec rm -rf {} \;

but the cron must delete dir client_download


I must delete only dir "inside" client download

why ?

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Simple Cron job


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway