Welcome to WebmasterWorld Guest from 54.226.246.160

Forum Moderators: bakedjake

Message Too Old, No Replies

Cron syntax

syntax for cron

     

webstyler

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

10+ Year Member



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

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

WebmasterWorld Senior Member 10+ Year Member



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

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

10+ Year Member



I try it :)

txx

webstyler

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

10+ Year Member



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

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

webstyler

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

10+ Year Member



ops, thx.. I try

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

thx

 

Featured Threads

Hot Threads This Week

Hot Threads This Month