1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

crontab

Discussion in 'Plesk for Windows - 8.x and Older' started by robinthecam, Dec 17, 2003.

  1. robinthecam

    robinthecam Guest

    0
     
    Hi there,

    I´m a newbie on setting up cron jobs... My Problem is, i want to execute a .php script on a specified time! can someone tell me what is the syntax for my command!

    Thanks in advance
    r
     
  2. defencer

    defencer Guest

    0
     
    1) find where your php interpreter resides

    $ which php
    /usr/local/bin/php

    2) Add the following line to begin of you php script:

    #!/usr/local/bin/php -q

    3) make you php script executable

    $chmod 755 /path/to/your/script.php

    4) Make sure you script works properly by trying to start it from the command line

    $ /path/to/your/script.php

    <script output here>

    5) add command line to your crontab

    $ crontab -e

    For example, to start script every day at 5:00:

    0 5 * * * /path/to/your/script.php
     
  3. tedocweb

    tedocweb Guest

    0
     
    duh ?

    Hey guys,

    Isn't this supposed to be the Windoze thread???

    Or am i missing something?
     
  4. envycom

    envycom Guest

    0
     
    Thanks defencer,

    Can you tell me what this does:

    Also...

    when i access this file from http it works fine, but from shell i get these errors.

    /home/httpd/vhosts/site/httpdocs/ts/page.php: ?: No such file or directory
    /home/httpd/vhosts/site/httpdocs/ts/page.php: line 3: syntax error near unexpected token `set_time_limit(0)'
    /home/httpd/vhosts/site/httpdocs/ts/page.php: line 3: `set_time_limit(0);'

    Thanks!
     
  5. envycom

    envycom Guest

    0
     
    ahh i think it was because i added the code inside the <?


    #!/usr/local/bin/php -q
    <?
    echo "hello";
    ?>

    works!

    i am getting this error in my actual file which works great through http, but not thorough shell.

    Fatal error: Call to undefined function: iconv() in /home/httpd/vhosts/site/httpdocs/tb/file.php on line 237

    $xml = iconv("ISO-8859-1", "UTF-8",$xml);
     
  6. siren@

    siren@ Guest

    0
     
    Are you running windows or linux? It makes a difference. This is a Windows forum and it looks like you are talking about Linux
     
  7. envycom

    envycom Guest

    0
     
    <Gack> yeah the previous post seemed relevant. maybe a moderator can cut this thread to plesk 6.0?
     
Loading...