Skip to content

Latest commit

 

History

History
57 lines (54 loc) · 2.67 KB

README.md

File metadata and controls

57 lines (54 loc) · 2.67 KB

Scheduler Service

This will be a possible future replacement / enhancement of the Scheduler-plugin and some things that are implemented in scheduled functions in other plugins or even complete services like cleanup and backup and maybe monitoring.

You can use it to run pre-defined actions at specific times. For now, this can be:

  • report - generate reports with the Reporting Framework
  • restart - restart your DCS servers or rotate missions (no user warning implemented yet!)
  • cmd - run a shell command

More to come.

Configuration

As per usual, the service is configured with a yaml file, in this case config/services/scheduler.yaml:

DEFAULT:
  actions:
    - cron: '0 * * * *'                 # run every full hour
      action:
        type: report                    # generate a report
        params:
          file: mysample.json           # using this template in reports/scheduler
          channel: 1122334455667788     # channel to post the report in
          persistent: true              # is it a persistent report? (default = true)
    - cron: '0 3 * * 0,2-6'             # reboot the server each night but Monday at 03:00
      action:
        type: restart                   
        params:
          reboot: true                  # reboot the PC (shutdown /r)
    - cron: '0 4 * * 1'                 # shut the server down once a week on Monday
      action:
        type: halt                      # reboot the server each monday night at 03:00
    - cron: '0 12 * * *'                # run every 12 hrs
      action:
        type: purge_channel             # purge Discord channels
        params:
          channel:                      # list of channels to purge
            - 112233445566778899
            - 998877665544332211
          delete_after: 7               # delete all messages that are older than 7 days
          ignore: 119922883377446655    # ignore this user id (probably the bots)
DCS.release_server:
  actions:
    - cron: '0 0,4,8,12,16,20 * * *'  # run every 4 hrs
      action:
        type: restart                 # restart the respective server that is linked to this instance
        params:
          shutdown: false             # do not shutdown during the restart (default = false)
          rotate: false               # do not rotate the mission (default = false)
          run_extensions: true        # run the extensions (default = true)
    - cron: '55 3 * * 1'                # Send a message to everyone, 5 mins prior to the shutdown
      action:
        type: popup                     
        params:
          message: Server will shut down in 5 mins!
          timeout: 20