I have a cronjob defined on an AWS ec2 (so it uses crontab). I did crontab -e
and added this line into it:
我在AWS ec2上定义了一个cronjob(所以它使用crontab)。我做了crontab -e并在其中添加了这一行:
*/1 * * * * /usr/bin/php /path/to/file/file.php
I saved it with vim and it says crontab: installing new crontab
. I also made the permissions on the file 755
, using chmod, and I put the proper shebang (#!/usr/bin/php -q
) at the top of file.php
. The script should update a database every minute, but I am not seeing the database get updated at all. What did I do wrong?
我用vim保存了它,它说crontab:安装新的crontab。我还使用chmod对文件755进行了权限,并将正确的shebang(#!/ usr / bin / php -q)放在file.php的顶部。该脚本应该每分钟更新一次数据库,但我没有看到数据库得到更新。我做错了什么?
1 个解决方案
#1
logging example: */1 * * * * >> /var/log//your_cron.log 2>&1
记录示例:* / 1 * * * * >> /var/log//your_cron.log 2>&1
#1
logging example: */1 * * * * >> /var/log//your_cron.log 2>&1
记录示例:* / 1 * * * * >> /var/log//your_cron.log 2>&1