Smos Logo Smos

A comprehensive self-management system

The Smos Scheduler Tool

Documentation for the Smos Scheduler Tool, for scheduling projects on a recurring basis

The smos-scheduler tool is configured most easily using a configuration file.

Example configuration:

    - description: "Weekly tasks"
      template: templates/weekly.smos.template
      destination: projects/weekly-[ %V | monday ].smos
      schedule: "0 12 * * 7" # Cron schedule: "At 12:00 on Sunday."

Example template at templates/weekly.smos.template:

- entry: Weekly actions
  - header: Weekly review
    state: READY
      SCHEDULED: "[ %F | saturday ]"

Run smos-scheduler check to make sure everything is ready for the template to be scheduled correctly.

Then run smos-scheduler schedule periodically. Once per hour or once per day should be enough but make sure to automate it.

Templating language

The destination filename as well as the template of the smos file itself use a templating language. Most of the contents are just literal text, but timestamps can be spliced in as necesary.

Splicing works using the [ template ] or [ template | fuzzy timestamp ] syntax. In practice, [ template ] is sugar for [ template | time at which the scheduler is run].

Some examples:

  • On 2020-07-19, [ %F ] becomes 2020-07-19.
  • On 2020-07-19, [ %W ] becomes 29. (%W represents the week number)
  • On 2020-07-19, [ %F | monday ] becomes 2020-07-20.
  • On 2020-07-19, [ %W | monday ] becomes 30. (%W represents the week number)



Usage: smos-scheduler COMMAND [--config-file FILEPATH] [--workflow-dir FILEPATH]
                      [--archive-dir FILEPATH] [--projects-dir FILEPATH] 
                      [--archived-projects-dir FILEPATH] [--state-file FILEPATH]
  Smos Scheduler Tool version: 0.1.3
  Current Smos data format version: 1.0.0

Available options:
  -h,--help                Show this help text
  --config-file FILEPATH   The config file to use
  --workflow-dir FILEPATH  The workflow directory to use
  --archive-dir FILEPATH   The archive directory to use
  --projects-dir FILEPATH  The projects directory to use
  --archived-projects-dir FILEPATH
                           The archived projects directory to use
  --state-file FILEPATH    The state file to use

Available commands:
  check                    Check that all schedules are sensible
  schedule                 Run the schedules


Available environment variables:

                         Archived projects directory
                         Archive directory
                         Workflow directory
                         Projects directory
  SMOS_STATE_FILE        The path to the file in which to
                         store the scheduler state
                         Workflow directory


# DirectoryConfiguration
workflow-dir: # optional
  # The workflow directory
archive-dir: # optional
  # The archive directory
projects-dir: # optional
  # The projects directory
archived-projects-dir: # optional
  # The archived projects directory
# Configuration
scheduler: # optional
  # The scheduler configuration
  # SchedulerConfiguration
  state-file: # optional
    # The file to store the scheduler state in
  schedule: # optional
    - # The scheduler schedule
      # ScheduleItem
      description: # optional
        # A description of this item
      template: # required
        # The file to copy from (relative, inside the workflow directory)
      destination: # required
        # The file to copy to (relative, inside the workflow directory)
      schedule: # required
        # The schedule on which to do the copying