View Full Version : Cron jobs
10-10-2008, 12:29 AM
I have never used cron jobs before but really need to set one up that deletes files in a certain folder every Friday.
I know how to set one up to run every Friday, but I'm just not sure what the command would be to do this.
10-10-2008, 07:23 AM
Do you have shell access. or you want to delete files through php script by cpanel
10-10-2008, 11:54 AM
Or there might be an interface in the CP to set cron jobs.
10-10-2008, 05:28 PM
Yep abduraooft, that's exactly what I'm using... but I just don't know what command to use. Unfortunately, I can't just type "Delete files in tmp folder" and set it for every Friday. I don't know what fancy linux code to use :p
10-10-2008, 11:34 PM
Make sure you back up before you do this...
Command you would probably want is something like this...
/bin/rm -f /path/to/directory/with/files/
if you need to delete the files + sub dirs...
/bin/rm -rf /path/to/directory/with/files/*
If you only want to delete html files
/bin/rm -f /path/to/directory/with/files/*.html
Note /bin/rm is the path on my system. It may be different on yours.
10-14-2008, 05:38 PM
Thanks! I'll give it a shot! Take care.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.