+ Reply to Thread
Results 1 to 6 of 6

Thread: Run PHP script every hour?

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    6

    Default Run PHP script every hour?

    Hi,
    Is it possible for me to set up a php script to be executed every hour? Like a cron job or something? If so, how? Thanks in advance.

  2. #2
    Junior Member
    Join Date
    Aug 2005
    Posts
    4

    Default

    I have not tried this but if you have shell access you should be able to add a cron entry by typing
    Code:
    crontab -e
    Also don't forget to add the following to the top of your php file
    Code:
    #!/usr/local/bin/php
    as well as give your file execute permissions with chmod.

  3. #3
    Administrator
    Join Date
    Jun 2004
    Location
    Chicago, Illinois, United States
    Posts
    248

    Default

    Cron jobs can be setup right from the H-Sphere control panel. It is listed under FTP & Shell Accounts.
    Karl Zimmerman
    President/CEO - NoZone, Inc./Steadfast Networks
    http://steadfast.net
    karl@steadfast.net

  4. #4
    Junior Member
    Join Date
    Feb 2008
    Posts
    2

    Default

    I'm also trying to set this up. I had it working at my old host but for some reason can't get it here. I think I might be doing the command wrong, so any help would be appreciated.

    I put the #! thing in my page, as stated before I had it working at my old host.

    Right now I have the settings as

    */5 * * * * /usr/local/bin/php /hsphere/local/home/crabrock/path to file

    This is how I had it set up before, but I'm not entirely sure on the path I should be using. Is this the correct way to do it?

  5. #5
    Ray
    Ray is offline
    I can't do everything.
    Join Date
    Jun 2004
    Location
    Plymouth, WI
    Posts
    134

    Default

    crabrock,

    The path will be similar to the following:

    /hsphere/local/home/username/domain.com/path/to/file

    I'm not sure if you were including the domain name already, but it needs to be in the path.

    That looks like the right path for PHP and such. If it still doesn't work after double checking the path, I'd probably suggest asking support for more information...
    Ray Tetzloff


  6. #6
    Junior Member
    Join Date
    Feb 2008
    Posts
    2

    Default

    yea, i included all that, it was just really long so i took it out of my post.

    I copied the file location straight out of my ftp browser, i set the chmod to 777

    well rats.

+ Reply to Thread

Posting Permissions

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