Configuring Cron

Backy provides an easy-to-use way to execute commands at a specified time.

Adding cron: 0 0 1 * * * to a cmdLists object will schedule the list at 1 in the morning. See https://crontab.guru/ for reference.

GoCron allows one to configure a server to view the jobs in the scheduler. See GoCron UI GitHub. GoCron can be configured or left alone for defaults.

GoCron configuration:

key description type required default
bindAddress Interface’s IP to bind to. Must not contain port. string no :port
port Port to use. int no 8888
useSeconds Whether to parse the second cron field. bool no false
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
goCron:
  bindAddress: "0.0.0.0"
  port: 8888
  useSeconds: true

cmdLists:
  docker-container-backup: # this can be any name you want
    # all commands have to be defined
    order:
      - stop-docker-container
      - backup-docker-container-script
      - shell-cmd
      - hostname
      - start-docker-container
    notifications:
      - matrix.id
    name: backup-some-container
    cron: "0 0 1 * * *"
  hostname:
    name: hostname
    order:
      - hostname
    notifications:
      - mail.prod-email