Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine Cron Job

I have created a cron.xml file and a servlet which describes the job.
Now when i compile and login as an admin, local development dashboard doesn't show Cron Jobs link.

like image 554
JAB Avatar asked Dec 18 '10 06:12

JAB


People also ask

What is cron job in Google App Engine?

The App Engine Cron Service allows you to configure regularly scheduled tasks that operate at defined times or regular intervals. These tasks are commonly known as cron jobs.

What does 0 * * * * mean in crontab?

0 * * * * -this means the cron will run always when the minutes are 0 (so hourly) 0 1 * * * - this means the cron will run always at 1 o'clock. * 1 * * * - this means the cron will run each minute when the hour is 1. So 1:00 , 1:01 , ... 1:59 .


2 Answers

Local development server does not have the Cron Jobs link neither does it execute cron jobs. The actual appengine will show cron jobs and will execute them.

You can manually execute cron jobs on local server by visiting their urls. e.g. http://localhost:8888/FindReservedBooksTask.

BTW the cron.xml file should be in the war/WEB-INF directory.

like image 97
nabeelmukhtar Avatar answered Oct 12 '22 22:10

nabeelmukhtar


The dev appserver doesn't automatically run your cron jobs. You can use your local desktop's cron or scheduled tasks interface to hit the URLs of your jobs with curl or a similar tool.

Here is the link to the GAE doc on this.

Also, make sure you disable all security constraints for your crons in the web.xml. If you don't have them -- you should restrict cron to admin accounts.

like image 32
averasko Avatar answered Oct 12 '22 23:10

averasko