How to setup cron job on Amazon Linux AMI

五迷三道 提交于 2019-12-12 08:37:42

问题


I am hosting Tiny Tiny RSS site hosted on

Amazon Linux AMI

To update the feed automatically I have to run following cron job.

Reference http://tt-rss.org/redmine/projects/tt-rss/wiki/UpdatingFeeds

*/30 * * * * /usr/bin/php /var/www/html/tt-rss/update.php --feeds --quiet

Here is the step I did:

  1. sudo su
  2. cd /etc
  3. crontab -e
  4. add this line */30 * * * * /usr/bin/php /var/www/html/tt-rss/update.php --feeds --quiet

But I still got the message "Update Daemon is not running".

May I know is this correct step for cron job?

My first setup.

Thanks, Alex


回答1:


You should first inspect the cron log file /var/log/cron and look for any errors. This will probably give you the answer. Also make sure you can run the command successfully on the command line (/usr/bin/php /var/www/html/tt-rss/update.php --feeds --quiet).




回答2:


This sounds like crond is not running. In which case:

service crond start
chkconfig crond on



回答3:


Please check the spaces, it could be because of spaces are not placed correctly




回答4:


Simply do : * * * * * wget -o - -q -t 1 "your url with cron file"




回答5:


Please remove the "--quiet" part from your cron command and check the log and feed again




回答6:


In Amazon Linux 2 you should enter these commands:

sudo systemctl start crond
sudo systemctl enable crond


来源:https://stackoverflow.com/questions/22305963/how-to-setup-cron-job-on-amazon-linux-ami

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!