Cron ist not working

2014-04-14
2014-05-04
  • Muschelpuster
    Muschelpuster
    2014-04-14

    I installed PHP Server Monitor at a raspberry pi on raspberian. Everything works fine, but the cron-job is not updating the server status.
    I activated the cron-logging and I see, that the job is started by the system. After that I created a log of the cron-job by doing the following in the cron:
    '/2 * * * root php /var/www/cron/status.cron.php >> /var/log/phpservmon.log'
    The file will be created and it's empty. So I think, there also no problem. (Using the root-account is already to exclude permission-problems)
    If I use the full path of the php file I get a error message:
    'This script can only be run from the command line.'
    That's why I use only the php-command.
    If I start the command as it is in the crontab from the console with the root-account, everythink works fine.

    Niels

     
  • Pep
    Pep
    2014-04-15

    Hi Niels,
    Can you try adding the following line to your config file and see if anything comes up:

    define('PSM_DEBUG', true);

    Regards,
    Pep

     
  • Muschelpuster
    Muschelpuster
    2014-04-17

    I found the problem. The example from the documentation is wrong for (debian) linux. The user-entry is wrong - there is a one cron-file for every user.
    So, right in this case ist the entry:
    /2 * * * php5 /var/www/cron/status.cron.php

    Niels

     
  • Pep
    Pep
    2014-05-04

    Thanks Niels, I have updated the documentation.