96 lines
3.2 KiB
YAML
96 lines
3.2 KiB
YAML
defaults:
|
|
cron: '0 3 * * *'
|
|
envs:
|
|
- key: RESTIC_PASSWORD_FILE
|
|
value: '/secrets/.resticpwd'
|
|
- key: RCLONE_PCLOUD
|
|
value: 'pcloud:Server/Backups'
|
|
- key: BASE_REPOSITORY
|
|
value: 'rclone:${RCLONE_PCLOUD}'
|
|
- key: APPDATA_PATH
|
|
value: '/mnt/user/appdata'
|
|
- key: REPOSITORIES
|
|
value: 'forgejo hedgedoc media paperless godash synapse traefik vaultwarden freshrss'
|
|
|
|
jobs:
|
|
- name: Cleanup
|
|
cron: '0 5 * * 0'
|
|
envs:
|
|
- key: RESTIC_POLICY
|
|
value: '--keep-daily 7 --keep-weekly 5 --keep-monthly 12 --keep-yearly 75'
|
|
- key: RESTIC_POLICY_SHORT
|
|
value: '--keep-last 7'
|
|
commands:
|
|
- command: for repo in ${REPOSITORIES}; do restic -r ${BASE_REPOSITORY}/$repo forget ${RESTIC_POLICY} --prune; done
|
|
- name: Unlock
|
|
cron: '0 4 * * 0'
|
|
commands:
|
|
- command: for repo in ${REPOSITORIES}; do restic -r ${BASE_REPOSITORY}/$repo unlock; done
|
|
- name: Forgejo
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/forgejo
|
|
commands:
|
|
- command: docker exec -e PASSWORD=password forgejo-db pg_dump db --username=user > ${APPDATA_PATH}/forgejo/.dbBackup.sql
|
|
- command: chmod 600 ${APPDATA_PATH}/forgejo/.dbBackup.sql
|
|
- command: restic backup ${APPDATA_PATH}/forgejo
|
|
- name: Hedgedoc
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/hedgedoc
|
|
commands:
|
|
- command: restic backup ${APPDATA_PATH}/hedgedoc
|
|
- name: Media
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/media
|
|
commands:
|
|
- command: restic backup ${APPDATA_PATH}/media
|
|
- name: Paperless
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/paperless
|
|
commands:
|
|
- command: docker exec paperless document_exporter /usr/src/paperless/export 1> /dev/null 2> ${APPDATA_PATH}/paperless/.export.log
|
|
- command: restic backup ${APPDATA_PATH}/paperless
|
|
- name: GoDash
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/godash
|
|
commands:
|
|
- command: restic backup ${APPDATA_PATH}/godash
|
|
- name: Matrix
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/synapse
|
|
commands:
|
|
- command: docker exec -e PASSWORD=password matrix-db pg_dumpall --username=postgres > ${APPDATA_PATH}/synapse/.dbBackup.sql
|
|
- command: chmod 600 ${APPDATA_PATH}/synapse/.dbBackup.sql
|
|
- command: restic backup ${APPDATA_PATH}/synapse
|
|
- name: Traefik
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/traefik
|
|
commands:
|
|
- command: restic backup ${APPDATA_PATH}/traefik
|
|
- name: Vaultwarden
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/vaultwarden
|
|
commands:
|
|
- command: restic backup ${APPDATA_PATH}/vaultwarden
|
|
- name: Freshrss
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/freshrss
|
|
commands:
|
|
- command: restic backup ${APPDATA_PATH}/freshrss
|
|
- name: Nextcloud
|
|
commands:
|
|
- command: rclone sync /mnt/user/nextcloud-backup ${RCLONE_PCLOUD}/nextcloud --multi-thread-streams=0
|
|
- name: Portainer
|
|
envs:
|
|
- key: RESTIC_REPOSITORY
|
|
value: ${BASE_REPOSITORY}/portainer
|
|
commands:
|
|
- command: restic backup ${APPDATA_PATH}/portainer
|