SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Cron cmd help
-
Dec 29, 2007, 17:00 #1
- Join Date
- Jul 2007
- Location
- London
- Posts
- 161
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Cron cmd help
Hi all
Trying to use a cron job to delete any file in a directory after 24hrs, however the one i've come up with doesn't seem to work. it is as follows
#!/bin/sh
find /home/roinsonc494/example.com/cache -ctime 24 -exec rm -f {} \;
Thanks for your help in advance.
-
Dec 30, 2007, 19:55 #2
I'd do it like this....
Code:find /home/roinsonc494/example.com/cache/ -mtime +1 -exec rm -f {} \;
Keep in mind you may also have permission problems. So you could schedule it in cron and output to a text file to review what went wrong.
Cheers,
Ed
-
Jan 3, 2008, 15:37 #3
- Join Date
- Jul 2007
- Location
- London
- Posts
- 161
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks for the reply will do
Bookmarks