Cron

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DavidPr
    New Member
    • Mar 2007
    • 155

    Cron

    Does anyone here know anything about crons?

    My web hosting company (IX Webhosting) offers me no help.

    To enter a cron I have to open my Control Panel - open FTP manager and open Crontab. I enter this for the day, time and command:

    Code:
    5 1 * * 1
    /usr/bin/curl -s -o /dev/null/hsphere/local/home/myusername/mysite.com/scripts/remove.php
    I just received an email from my server giving me the results of the cron:

    curl: no URL specified!
    curl: try 'curl --help' for more information


    Supposedly, the script should run 5 minutes after 1:00am every Sunday. This cron job has been installed for over one month and I just now received one email telling me that it doesn't work.

    I've also tried this:

    Code:
    0 * * * *
    php /hsphere/local/home/myusername/mysite.com/scripts/remove.php
    I recieved this message:

    /bin/sh: php: command not found

    Anyone have any ideas how I can put together a cron that actually works? I'm on a shared hosting server (like 98% of all websites), and it uses unix or linux.

    Thanks
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, David.

    Compare your settings against this handy-dandy reference:
    cron - Wikipedia, the free encyclopedia

    If you have shell access, use `which php` to find out where PHP is installed on your server (most likely /usr/bin/php or /usr/local/bin/php).

    Otherwise, you can fake it by creating a quick PHP script to find out:

    [code=php]
    <?php echo `which php`; ?>
    [/code]

    Note that those are backticks, not quotes:
    PHP: Execution Operators - Manual

    Comment

    • DavidPr
      New Member
      • Mar 2007
      • 155

      #3
      IXWebhosting does not allow Shell access. They use a program called WebShell, which is their FTP program, which is accessed by clicking on the File Manager icon in the Control Panel. I don't think they use C-Panel as their Control Panel, I believe it's their own design.

      WebShell displays all of your domains and the folders and files located within each one. In my domain I have a folder called cgi-bin and in it is:

      Php-cgi - 20.924MB
      Php4-cgi - 5.296MB
      Php5-cgi - 21.275MB

      I assume this is the Php program's for my website.

      Comment

      • DavidPr
        New Member
        • Mar 2007
        • 155

        #4
        I'll try this:

        /usr/bin/php /hsphere/local/home/myusername/mysite.com/scripts/remove.php

        We'll see.

        Comment

        • DavidPr
          New Member
          • Mar 2007
          • 155

          #5
          Well I've tried these:

          /usr/bin/php/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: No such file or directory

          /user/bin/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: No such file or directory

          /usr/local/bin/php/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: No such file or directory

          /usr/local/bin/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: No such file or directory

          /hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: Permission denied

          The chmod for the immediate above is set to 755. So far, nothing I've tried has worked.

          Comment

          • nizamkhir
            New Member
            • Jan 2016
            • 1

            #6
            /hsphere/shared/php5/bin/php /local/home/myusername/mysite.com/scripts/scriptname.php

            Comment

            Working...