Skip to main content

Periodic task with timezone

Project description

https://travis-ci.org/vertisfinance/periodtask.svg?branch=master https://coveralls.io/repos/github/vertisfinance/periodtask/badge.svg?branch=master

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


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.1.tar.gz (8.7 kB view details)

Uploaded Source

File details

Details for the file periodtask-0.5.1.tar.gz.

File metadata

  • Download URL: periodtask-0.5.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for periodtask-0.5.1.tar.gz
Algorithm Hash digest
SHA256 aeaa517ea116d83176ec5a13958fc0b8cc4bb42a447dc8a7c655f46939e0d1e7
MD5 d4f0bf63fd1a9045699c78bc393897c0
BLAKE2b-256 ae56c2a3412017b494f3c9bf676b6fa37032abb4bd446ba17eb8a7916678edf1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page