https://github.com/better/cronner
https://github.com/better/cronner
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/better/cronner
- Owner: better
- License: mit
- Created: 2018-04-03T16:37:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T10:28:58.000Z (about 3 years ago)
- Last Synced: 2025-03-25T03:02:02.875Z (about 1 year ago)
- Language: Python
- Size: 34.2 KB
- Stars: 21
- Watchers: 122
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Easily schedule python functions to be run under cron
[](https://travis-ci.org/better/cronner)
## Make an HTTPS GET request to `google.com` every minute
Create the following file and name it `test.py`.
```python
import cronner
import random
try:
from urllib.request import urlopen
except:
from urllib import urlopen
@cronner.register('* * * * *')
def write_randint():
urlopen('https://google.com')
cronner.main()
```
Run this.
```sh
$ python test.py gen-cfg | crontab -
```
That's it.
## Installation
```sh
$ pip install cronner
```