gentoo crontab: why this simple crontab is not working?

后端 未结 1 710
青春惊慌失措
青春惊慌失措 2021-01-29 10:53

I use a GENTOO distribution.

crontab -e

35 12  * * *    root    php5 /home/www/cron.php

When I run manually:

php5 php5         


        
1条回答
  •  失恋的感觉
    2021-01-29 11:14

    The syntax you use in crontab -e does not allow you to specify the user name; it always runs as yourself.

    So, the root is a syntax error (it causes Cron to try to run the command root, which probably does not exist); take it out and try again.

    If you need the job to run as root, put the file (now with the user name) in /etc/cron.d/.

    0 讨论(0)
提交回复
热议问题