version: 3 mainunit: backup-manager plugins: - type: builtin name: backups_none - type: builtin name: monitoring config: checks: - name: main message: Backup manager activated interval: 3600 okvalue: active command: systemctl is-active --user backup-manager.timer - name: lastrun message: Errors last run interval: 3600 okvalue: "" command: cat {{ homedir }}/.backupmanager.errors - name: lastrunrecent message: Backup manager did not run recently interval: 3600 okvalue: "OK" command: '[ -f {{ homedir }}/.backupmanager.errors ] && [ $(find {{ homedir }}/.backupmanager.errors -mtime -2) ] && echo "OK" || echo "outdated"' enableunits: - backup-manager.timer templatefiles: - src: backup-manager.timer.j2 dest: ~/.config/systemd/user/backup-manager.timer - src: backup-manager.service.j2 dest: ~/.config/systemd/user/backup-manager.service - src: backupmanager.j2 dest: ~/backupmanager mode: "0755" - src: monitor-test.sh.j2 dest: ~/monitor-test.sh mode: "0755" configdefinition: "$id": "backup manager config" "$schema": "http://json-schema.org/draft-07/schema#" description: backup-manager configuration type: object additionalProperties: false properties: default_cleanup_parameters: type: string default: "--keep-last 5 --keep-hourly 24 --keep-daily 5 --group-by host" description: The default cleanup parameters when they have not been specified repos: type: array description: All repos that will be kept in sync. items: type: object additionalProperties: false properties: name: type: string description: Name of the repository. Used for display purposes but also for the status file url: type: string description: The url for the repository key: type: string description: The encryption key for the repository hosts: type: array description: The list of hostnames that are and should be on this repository items: type: string description: Hostname minItems: 1 cleanup_parameters: type: string description: The cleanup parameters used for this repository. Defaults to default_cleanup_parameters when not specified check_repo: type: boolean default: false description: Whether we need to perform a check on the repository required: - url - key - hosts - name hosts: type: object description: Settings per host being backed up default: {} additionalProperties: type: object additionalProperties: false properties: idle: type: boolean default: false description: An idle repository will never give warnings that there are no recent backups needscopy: type: boolean default: true description: Will backup manager complain if there is no copy of the backup timeout: type: integer # note that the default is also in the python code - in case the host isn't filled in default: 10 description: Repositories where the latest backup is older then timeout days will give a warning that there are no recent backups required: - repos