问题
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:
- sudo su
- cd /etc
- crontab -e
- 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