Skip to main content

A tool to help you schedule your task according to your config file

Project description

task-scheduler

task-scheduler is an in-process scheduler to arrange and run the task periodically according to YAML config file

Inspired by schedule

Usage

$ pip intall taskscheduler
$ taskscheduler -f tasks.yml

The format of tasks.yml is as below:

task:
   <First task name>
     schedule_time_unit: [seconds/minutes/hours/day/monday/Thusday]
     schedule_time_every: 1
     prepare:
        - <shell command>
        - <shell command>
     jobs:
       <jobname>:
         - <shell command>
       <jobname>:
         - <shell command>

In the example below, we have two jobs in tasks.yml, a prepare job is used to install the additional package and print some messages:

task:
   schedule_task1:
     schedule_time_unit: seconds
     schedule_time_every: 2

     jobs:
       test1:
         - echo 'Hi, this is task-scheduler'

   schedule_task2:
     schedule_time_unit: minutes
     schedule_time_every: 2

     prepare:
       - pip install pyyaml

     jobs:
       test1:
         - echo 'Hello world'

History

0.0.2 (2017-06-20)

  • Update execute name

0.0.1 (2017-05-10)

  • First version

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

py-task-scheduler-0.0.2.tar.gz (3.4 kB view hashes)

Uploaded Source

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