cron jobs again

Discussion in 'Installation/Configuration' started by Appie Thrasher, Mar 25, 2007.

  1. Appie Thrasher

    Appie Thrasher Member HowtoForge Supporter

    Hi al there I need a bid of help again.

    With the help of this forum I know that if I want to set an cronjob I must use
    Code:
    crontab -e
    .

    If I follow my script I must put in crontab this line
    Code:
    */10 * * * * lynx --dump http://www.mydomain.nl/scripts/admin/cronjobs.php  > /dev/null
    but that doesn't seems to work.

    Can I put a direct link to my script something like this?
    Code:
    */10 * * * /root/ispconfig/php/php /var/www/web4/web/scripts/admin/cronjobs.php > /dev/null
    this one isn't working also but I just guest the code, I used the existing crontab and used the path to my script.

    Any body an idee to get my script up and running??

    TIA DaRKNeSS
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. Appie Thrasher

    Appie Thrasher Member HowtoForge Supporter

    Going to try that Till. I will let you know what happend.
     
  4. Appie Thrasher

    Appie Thrasher Member HowtoForge Supporter

    I have tryed this
    Code:
    */10 * * * * usr/bin/lynx --dump http://www.mydomain.nl/scripts/admin/cronjobs.php  > /dev/null
    But it isn't working some other sugestions??
     
    Last edited: Mar 25, 2007
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    It must be:

    /usr/bin/lynx

    and not

    usr/bin/lynx

    If a path does not have the / in front, it is a relative path and what we need here is the absolute path.
     
  6. Appie Thrasher

    Appie Thrasher Member HowtoForge Supporter

    First of all thanks again Till for trying to help me out.

    The last sugestion didn't work also so again I am stuck.
    Can't I point to the script directly for example
    Code:
    */10 * * * * /usr/bin/lynx --dump /var/www/web4/web/scripts/admin/cronjobs.php > /dev/null
    I also noticed that in the example cron from the script the "&" isn't there at the end. In the cronjobs from ISPConfig there is an "&".

    DaRKNeSS
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    This can not work, you mx up http path's with filesystem path's. Lynx is a webbrowser.

    Do you want to execute your PHP script in in your apache server or as a shell script. In shell scripts you can not use all php functions like e.g. header redirects, thats why I posted you above the instructions on how to execute your script in a browser.

    Does it work if you execute this line on the shell:

    /usr/bin/lynx --dump http://www.mydomain.nl/scripts/admin/cronjobs.php
     
  8. Appie Thrasher

    Appie Thrasher Member HowtoForge Supporter

    Okee Till I think the cronjob is working now. Must wait and I will see. I have used
    Code:
    */10 * * * * /usr/bin/lynx --dump http://www.mydomain.nl/scripts/admin/cronjobs.php &> /dev/null
    I still cant email through that cron job but I am beginning to believe that is an script thing, must make contact with its developer and we'll know.

    BTW Till what's the diference between a line that end's like this, &> /dev/null
    and one whitout the &?

    Thanks again

    DaRKNeSS
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    The & sends the process to the background. For example, if you execute a command on the shell like generating the webalizer statistics, it will take several minutes and you are not able to enter anything in the shell until the job is finished. If you add a & at the end of the commandline when you execute the webalizer command, the command prompt will return instantly and the webalizer job is executed in the background.
     

Share This Page