1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unlink .txt file every 2 hours

Discussion in 'HTML & JavaScript' started by AnonLeo, Jan 12, 2014.

Tags:
  1. AnonLeo

    AnonLeo Regular Member

    Joined:
    Nov 23, 2013
    Messages:
    362
    Likes Received:
    263
    Location:
    USA
    I was looking at the PHP site and found the "unlink" script

    what I want is a time script to automatically unlink my "usernames.txt" file every 2 hours

    Is it possible to do that?

    Thanks :)
     
  2. bartosimpsonio

    bartosimpsonio Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 21, 2013
    Messages:
    8,835
    Likes Received:
    7,445
    Occupation:
    ZLinky2Buy SEO Services
    Location:
    ⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩
    Home Page:
    Yeah. Search for "cron" - you can customize the crontab to any period you want. Then a cron job can run your script every 2 hours.
     
  3. AnonLeo

    AnonLeo Regular Member

    Joined:
    Nov 23, 2013
    Messages:
    362
    Likes Received:
    263
    Location:
    USA
    That's what they told me on Stackoverflow, but I don't understand the corn and how it works :/
     
  4. cr0n1k

    cr0n1k Registered Member

    Joined:
    May 13, 2010
    Messages:
    71
    Likes Received:
    23
    Location:
    UK
    there you go,is your best friend

    http://lmgtfy.com/?q=cron+tutorial+
     
    • Thanks Thanks x 1
  5. mypmmail

    mypmmail Junior Member

    Joined:
    Jan 31, 2008
    Messages:
    111
    Likes Received:
    27
    Just for your info.

    There is a slight difference between cron returned by google to the cron you implement on a shared hosting.

    Technically, there isn't a difference.
    But on shared hosting, you cannot access the shell directly, thus, you need to set the cron job through the cpanel or plesk, which is a more user friendly interface, to achieve the same result.
    Logically, the cpanel version is more user friendly, thus, if you master the command line version, the cpanel should not be a problem.
     
    • Thanks Thanks x 1
  6. AnonLeo

    AnonLeo Regular Member

    Joined:
    Nov 23, 2013
    Messages:
    362
    Likes Received:
    263
    Location:
    USA
    I have a cpanel (VPS), I searched for "corn" and didn't find any results :/
     
  7. laowai

    laowai Power Member

    Joined:
    Feb 27, 2011
    Messages:
    522
    Likes Received:
    184
    Try to search "cron" not "corn" and you will find what you need
     
    • Thanks Thanks x 2
  8. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,143
    Corn.jpg

    .
     
    • Thanks Thanks x 3
  9. netbull2007

    netbull2007 Newbie

    Joined:
    Mar 7, 2014
    Messages:
    8
    Likes Received:
    6
    every cPanel supports cron jobs. this basicly is a program witch runs on specific time interval /you configurate that/ and run a php file with the unlick function.
     
  10. gtownfunk

    gtownfunk Registered Member

    Joined:
    Jan 26, 2011
    Messages:
    99
    Likes Received:
    26
    Occupation:
    Software Developer
    Location:
    Austin, TX
    Home Page:
    Has anyone found the corn job yet? Poor guy is going to never be able to schedule a task without thinking about Nebraska...

    gtownfunk
     
  11. TorrentCoder

    TorrentCoder Newbie

    Joined:
    Feb 3, 2014
    Messages:
    15
    Likes Received:
    1

    Simply create a PHP file with the unlink method and set the cron as: 0 */2 * * * /path-to-php-file