homepage Welcome to WebmasterWorld Guest from 50.19.169.37
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Cron syntax
syntax for cron
webstyler




msg:3185987
 7:36 am on Dec 12, 2006 (gmt 0)

Hi :)

I need to remove all files and dir into /mydir/ any 60 minutes

I have setting thi on Cpanel cronjob

find /home/myuser/public_html/mydir/ -cmin +60 -exec rm -rf {} \;

It's ok, only problem is that dir /mydir/ is deleted :'(

?

thx

 

mcavic




msg:3186010
 8:17 am on Dec 12, 2006 (gmt 0)

find /home/myuser/public_html/mydir/* -depth -cmin +60 -exec rm -rf {} \;

The * says only look at stuff inside mydir, not mydir itself. And the -depth should eliminate any file/directory not found errors.

webstyler




msg:3186650
 7:05 pm on Dec 12, 2006 (gmt 0)

I try it :)

txx

webstyler




msg:3187136
 7:10 am on Dec 13, 2006 (gmt 0)

it's Ok :D

I have another question about it

I receive any hour a email:
find: /myuser/public_html/mydir/*: No such file or directory

how tell with cron to not sent email IF files/dir not found?

txx

mcavic




msg:3187137
 7:12 am on Dec 13, 2006 (gmt 0)

[webmasterworld.com...]

webstyler




msg:3187147
 7:24 am on Dec 13, 2006 (gmt 0)

ops, thx.. I try

I haven't receive notify about your reply on prev. thread

thx

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved