bladechob Posted February 20, 2008 Share Posted February 20, 2008 Hi, I've got a vacancies database where I'd like to delete all jobs that are posted that are over 3 months old automatically. I.e. they reach a shelf life of 3 months then bye bye! Would I do this via a cron job or in the job posting page? Help appreciated Quote Link to comment Share on other sites More sharing options...
aebstract Posted February 20, 2008 Share Posted February 20, 2008 I would vote a cron job. Quote Link to comment Share on other sites More sharing options...
Sulman Posted February 20, 2008 Share Posted February 20, 2008 You could do it in the job posting page but if no one visits that page for a few months you could have some very old data in there. Cron job would probably be best. Quote Link to comment Share on other sites More sharing options...
aschk Posted February 20, 2008 Share Posted February 20, 2008 I guess you've got to weight up the advantages/pitfalls of each option 1) Cron job 2) Per page load (posting page) As i see it, the 1st option will mean it's done regularly, but you need to find a schedule that suits you. Probably daily (during the early hours) would be best, and this way your data is updated on a daily basis, meaning it's up-to-date. The 2nd option on the other hand means higher load on your server (doing the check every time the page is "posting"), with possibly unnecessary actions (deleting nothing). If it's not used often it won't affect the process load, but you may still be performing unnecessary actions. Quote Link to comment Share on other sites More sharing options...
bladechob Posted February 20, 2008 Author Share Posted February 20, 2008 Well cron job it is then - next question is what would the command line be Quote Link to comment Share on other sites More sharing options...
tinker Posted February 20, 2008 Share Posted February 20, 2008 most my sites are in the style of a cms, so a (restricted area) page is called, which just uses php/mysql as usual, also generates a log (+backup if required)... Quote Link to comment Share on other sites More sharing options...
bladechob Posted February 20, 2008 Author Share Posted February 20, 2008 thanks for that Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.