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

    0 24 * * * php /root/scripts/backup_mysql.php
    15 * * * * wget -q -O /dev/null
    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

    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

    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.

    0 24 * * * /usr/bin/php "/root/scripts/backup_mysql.php"
    15 * * * * /usr/bin/wget -q -O /dev/null
  6. marcoslavorato

    marcoslavorato New Member

    Thanks till, working fine, now.
: cron

Share This Page