Tuesday, January 31, 2017

linux - crontab schedules and cron jobs



I've put two files in the /etc/cron.d/ directory:



The first makes a new post everyday at 12:00AM:



0 0 * * * php /var/www/site1/helper post:make



The second updates the latest post every 10 minutes



10 * * * * php /var/www/site1/helper post:update


Do I have to do something else for this job to run based on the time (eg. every 10 minutes) or do I have to do crontab job1 and crontab job2?



EDIT: I also installed cronie.


Answer



Putting files in cron.d is enough. However, your last entry should be:




*/10 * * * * php /var/www/site1/helper post:update


Otherwise it runs once an hour, at the 10th minute.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...