I've been looking at the latest checkout (35) of the AppEngine SDK (which might be the same as 1.1.8), trying to at least figure out how cron *will* work. Here's what I've found so far.
Interestingly, the SDK's antlr definitions are incompatible with the version of antlr invluded in the sdk, so I had to rename lib/antlr3 and install 3.1.1 from
http://www.antlr.org/download/Python
There's a new yaml file at the root of your application, "cron.yaml". Here's a simple one that validates:
-------------------
cron:
- url: /cron
schedule: every 2 hours
-------------------
You can also optionally include a timezone and description. Here's what groctimespecification.py says about the schedule format:
"A Groc schedule looks like '1st,2nd monday 9:00', or 'every 20 mins'. This
module takes a parsed schedule (produced by Antlr) and creates objects that
can produce times that match this schedule."
If cron.yaml is present but empty or invalid, appcfg.py update fails with "google.appengine.api.croninfo.MalformedCronfigurationFile", if the schedule line is invalid, it fails with "Error parsing yaml file:". Otherwise, cron definitions are uploaded distinctly from all the other files.
theross@localhost:~/projects/appname$ appcfg.py update .
Scanning files on local disk.
Scanned 500 files.
Initiating update.
Cloning 155 static files.
Cloned 100 files.
Cloning 57 application files.
Closing update.
Uploading index definitions.
Uploading cron entries.So, all the SDK pieces appear to work, but my testing indicates this isn't running on the production servers yet-- I set up an "every 1 minutes" cron that logs when it runs, and it hasn't been called yet
They DO show up in the dashboard though, under admin logs:
01/19/09 07:32:28
|
rosska...@gmail.com |
Added cron job 'None' |
schedule=every 2 hours, url=/cron |
01/19/09 07:32:28
|
rosska...@gmail.com |
Removed cron job 'None ' |
schedule=every 1 minutes, url=/cron |