SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Set a timer to server clock

    Hi guys,

    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

    Silversurfer
    "Persistence is the path to perfection"

  2. #2
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Take a look here: http://codeaid.net/php/calculate-scr...me-(php-class) I have used something similar before and it works well for what you describe.

    Regards,
    Steve
    ictus==""

  3. #3
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    thanks again
    "Persistence is the path to perfection"

  4. #4
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Steve,

    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?
    "Persistence is the path to perfection"

  5. #5
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,072
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by silversurfer5150 View Post
    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.
    thanks again
    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.
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  6. #6
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    "Persistence is the path to perfection"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •