简体   繁体   English

Raspbian Cron工作无法正常工作

[英]Raspbian Cron Job Not Working

Hi I have created this cron job in the /etc/crontab file: */2 * * * * /usr/bin/php /var/www/html/daily_scripts/store_all_currencies.php . 嗨,我在/ etc / crontab文件中创建了此cron作业: */2 * * * * /usr/bin/php /var/www/html/daily_scripts/store_all_currencies.php It doesnt seem to be working I just want my store_all_currencies.php to run every 2 minutes. 它似乎不起作用,我只希望我的store_all_currencies.php每2分钟运行一次。

I have had a look in /usr/bin/ and there doesnt seem to be a php file? 我看过/ usr / bin /,似乎没有php文件? This is probably the reason it isnt working. 这可能是它不起作用的原因。 I am able to run php files from the console so it is definitely installed. 我能够从控制台运行php文件,因此它肯定已安装。

I think you should try like this for executing cron every 2 minutes, but you must have the php script inside /usr/bin/php/ var/www/html/daily_scripts before execute it. 我认为您应该尝试像这样每2分钟执行一次cron,但是在执行之前,必须在/usr/bin/php/ var/www/html/daily_scripts包含php脚本。 format => cron format php path php filename 格式=> cron format php path php filename

*/2 * * * * /usr/bin/php/ var/www/html/daily_scripts/store_all_currencies.php

Every 2 minutes : https://crontab.guru/every-2-minutes 每2分钟: https//crontab.guru/每2分钟

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM