Created
December 19, 2012 08:31
-
-
Save mgng/4335295 to your computer and use it in GitHub Desktop.
GAE for Python で web cron 実行させる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| application: yourappname | |
| version: 1 | |
| runtime: python | |
| api_version: 1 | |
| threadsafe: false | |
| handlers: | |
| - url: /webcron | |
| script: webcron.py | |
| login: admin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cron: | |
| - description: web cron sample | |
| url: /webcron | |
| schedule: every 1 hours | |
| timezone: Asia/Tokyo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| appcfg.py --oauth2 --noauth_local_webserver update /path/to/webcron |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### webcron.py ### | |
| # coding=utf-8 | |
| import cgi | |
| from google.appengine.api import urlfetch | |
| url = "http://実行させたいURL" | |
| result = urlfetch.fetch(url) | |
| print 'Content-Type: text/plain; charset=utf-8' | |
| print '' | |
| print 'webcron' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment