Forum Moderators: coopster

Message Too Old, No Replies

Start cleanup script @ certain time

         

bobnew32

7:17 pm on Apr 24, 2004 (gmt 0)

10+ Year Member



I have a cleanup script dealing with the deletion of certain unused rows, and posts that are marked for deletion. I need this script run about every four hours, but I am unsure how to do this. Does anyone know how?

Elijah

8:30 pm on Apr 24, 2004 (gmt 0)

10+ Year Member



Maybe Cron [google.com]?

bobnew32

3:54 am on Apr 25, 2004 (gmt 0)

10+ Year Member



Cron seems viable, but I couldnt get it to work before with my cpanel (confusing). Is there any aid I could get to just simply have it execute a script every four pages? Seems pretty simple imo, the logic part.

hakre

2:03 pm on Apr 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi bobnew32,

to execute every 4 pages you need to make a counter. that could be a file you're storing the current number in (may leed to probs if too many scripts are accessing it the same time) or you should store the value in a database.

but anyways, i think you really should use cron for that, it will help you and will avoid a lot of problems. if you've got cpanel, contact your support personnel and let them help you to setup cron-jobs.

--hakre

bobnew32

2:45 pm on Apr 25, 2004 (gmt 0)

10+ Year Member



-_-

Sorry about that, I didn't mean four pages in my last post, I mean four hours. Sorry.

dcrombie

3:03 pm on Apr 25, 2004 (gmt 0)



cron or crontab is really the best way to go. The format is something like:

crontab -e

MAILTO="your@email.address" 
0 /4 * * * /path/to/script