1
votes

I want to schedule a cron job in Google App Engine.

I have a url that I would like to call, this is the job.

I am not cron job knowledgeable, but the developer of the files I want to run provided the command line I am to run.

I read the Google App Engine PHP cron job documentation, and I understand the scheduling part. From the documentation's example, I would use the path "/backup." However, I don't know how would I write the file to enter the command.

This is a link to the documentation: https://developers.google.com/appengine/docs/php/config/cron

THE SCHEDULING PART (I understand this):

file cron.yaml

cron:
- description: weekly backup
  url: /backup
  schedule: every monday 05:00
  timezone: America/Los_Angeles

The cron command line (if this is what is called) is:

curl -b /tmp/cookies.txt -c /tmp/cookies.txt -L --max-redirs 1000 -v "http://somedomain.com/index.php?option=someoption&view=someview&key=somekey"

Notice I am calling a url, the url is NOT in the GAE

I am using the GAE PHP SDK

Where would I write the cron command?

What is file extension for this code?

1
Your "developer" doesn't know what app engine is. He wants that curl command to run on some random unix server somewhere; it can't be run directly on app engine.Wooble
So you give me a negative vote for asking?IberoMedia

1 Answers

1
votes

Your Cron will call the backup url at every monday at 5 am

cron:
- description: weekly backup
  url: /backup
  schedule: every monday 05:00
  timezone: America/Los_Angeles

Create a php handler for that, and use the same logic the developer provided inside the backup handler.

So at 5 am the cron runs -> requests /backup -> curls the url you want or whatever

EDIT

I forgot that GAE does not support curl. Use urlfetch if possible. Also look at wrappers and this nice answer about this matter