Cron does not work

Discussion in 'General' started by marcoslavorato, Oct 27, 2010.

  1. marcoslavorato

    marcoslavorato New Member

    Hello all. I have a problem configuring the crontab on my server. I follow this steps.

    1. Edit using nano crontab -e command
    2. Add this lines
    Code:

    Code:
    0 24 * * * php /root/scripts/backup_mysql.php
    15 * * * * wget -q -O /dev/null http://domain.com/cronjob/atualiza-horas
    3. Save the file and run the /sbin/service crond start command

    This both cronjobs does not execute. How can I make this work? The second cronjob is without the link.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You have to use the full path to applications in cronjobs. E.g. /usr/bin/php and not just php
     
  3. marcoslavorato

    marcoslavorato New Member

    Thanks till. And the second command, do you know why does not work?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Same reason. You have to use the full path for every command that you use in a cronjob. If you dont know the full path, then you can get it with the which command. e.g.

    which wget
     
  5. marcoslavorato

    marcoslavorato New Member

    till, thanks again but it still no working. Look how is my cron file. I tried in the log but I can't found anything.

    Code:
    0 24 * * * /usr/bin/php "/root/scripts/backup_mysql.php"
    15 * * * * /usr/bin/wget -q -O /dev/null http://domain.com/cronjob/atualiza-horas
     
  6. marcoslavorato

    marcoslavorato New Member

    Thanks till, working fine, now.
     

Share This Page