Page 1 of 1
A script that runs automatically...say...once a day?
Posted: Sun Aug 01, 2004 7:30 pm
by paladaxar
Okie dokie. I am building a website where people list things for a set amount of time (ex. one week, 3 days, etc.) Once the time of thier listing runs out, it is useless to keep thier entry in the database. Is there any way that I can write a PHP script that automatically runs (maybe once a day) and cleans up the database by removing outdated entries?
Thank you in advance...You guys are awesome!
Posted: Sun Aug 01, 2004 7:47 pm
by evilmonkey
Cron job?
Posted: Sun Aug 01, 2004 7:47 pm
by paladaxar
Newbie here. Explain "Cron Job"
Posted: Sun Aug 01, 2004 9:04 pm
by kettle_drum
Its a service on linux/unix machines that executes certain commands/programs at certain points in time. "man cron" if you have a linux machine, if you dont then take a look at the schedual thing in windows.
Posted: Wed Aug 04, 2004 11:56 am
by HaVoC
If your host uses cPanel login and there's an option called 'Cron jobs' Set one up.
Posted: Wed Aug 04, 2004 6:33 pm
by LiquidPro
Another thing you could do is before your site does any work, you could simply check the database for their times, if any of the times are up... it removes it from the database. You'd need to store the initial time that the service started in the database, that way you can check it against the current time. It's basically making a script cron job, which doesn't need your linux service to do it.
If you need me to elaborate more... let me know.