silversurfer5150 — 2012-03-10T11:10:37-05:00 — #1
I want to set a timer on my site timed to the server clock to start running upon the execution of a certain script and then after the designated time expires, I want another script to run.
How complex is this does anyone have any php code examples?
thanks in advance
serverstorm — 2012-03-10T11:40:10-05:00 — #2
Take a look here: http://codeaid.net/php/calculate-script-execution-time-(php-class) I have used something similar before and it works well for what you describe.
silversurfer5150 — 2012-03-10T12:08:49-05:00 — #3
Thanks serverstorm, as it's you I'll explain why I'm doing this, I want to automatically delete that sensitive data after a week to make sure that I don't hang onto it longer than necessary and therefore eliminate the need to do it manually.
silversurfer5150 — 2012-03-10T12:50:49-05:00 — #4
From what I can understand, that script is just a very accurate timing script, I suppose what I really want to do is schedule the deletion script to run after say a week. What is the best option for this?
spacephoenix — 2012-03-10T14:06:13-05:00 — #5
Have you considered a cron job? The cron job could be set to run at the same time each day and if the data has been stored for less then 7 days it's left alone, if it's been stored for 7 or anything over 7 days it gets deleted.
silversurfer5150 — 2012-03-10T14:54:07-05:00 — #6
Yeh I did read about that I was going to ask our hosting to schedule one to tell my deletion script to run. Do you think it would be more practical to tunnel in with a cron job shell command and delete like that, its jus tthat I don't know the shell at all, only, php.