Periodic task with timezone
Project description
Periodic task with timezone
#!/usr/bin/env python3
import logging
import os
from periodtask import TaskList, Task
from periodtask.mailsender import MailSender
logging.basicConfig(level=logging.INFO)
send_success = MailSender(
os.environ.get('EMAIL_HOST'),
int(os.environ.get('EMAIL_PORT')),
os.environ.get('EMAIL_FROM'),
os.environ.get('EMAIL_RECIPIENT'),
).send_mail
tasks = TaskList(
Task(
name='test',
command=('ls', '-al'),
periods='* * * * * Europe/Budapest * 0',
run_on_start=True,
mail_success=True,
send_mail_func=send_success,
),
Task(
name='test',
command=('cat', 'README.rst'),
periods='* * * * * Europe/Budapest * 0',
run_on_start=True,
mail_success=send_success,
)
)
tasks.start()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
periodtask-0.5.3.tar.gz
(10.1 kB
view details)
File details
Details for the file periodtask-0.5.3.tar.gz
.
File metadata
- Download URL: periodtask-0.5.3.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4757f7e00e84be08014dcb25974d2f2aa7e6669a8aad48276b317d126dffe716 |
|
MD5 | 3f8c1aa109bf46d027b190029ddcc346 |
|
BLAKE2b-256 | abd4abad8494b94fb9218b9ee2ec0fbfd52a6eea89dacd7fb969f42d0d81a4c1 |