|
|
|
@ -22,6 +22,29 @@ systemd:
|
|
|
|
|
- name: app.service
|
|
|
|
|
enabled: true
|
|
|
|
|
contents_local: app/app.service
|
|
|
|
|
- name: restic-backup.service
|
|
|
|
|
contents: |
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=Backs up application data
|
|
|
|
|
Conflicts=app.service
|
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
Type=oneshot
|
|
|
|
|
EnvironmentFile=/restic-env
|
|
|
|
|
ExecStart=/usr/bin/bash -c "docker run --rm --volume /nassella:/nassella --volume /restic-password:/restic-password -e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} -e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} -i restic/restic:0.18.0 backup --verbose --repo s3:s3.us-west-004.backblazeb2.com/nassella-test-bucket --password-file /restic-password /nassella"
|
|
|
|
|
ExecStopPost=systemctl start app.service
|
|
|
|
|
|
|
|
|
|
- name: restic-backup.timer
|
|
|
|
|
contents: |
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=Run restic-backup.service at 3am PT
|
|
|
|
|
|
|
|
|
|
[Timer]
|
|
|
|
|
OnCalendar=*-*-* 10:00:00
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
|
|
|
|
|
|
### docker-compose sysext
|
|
|
|
|
### https://flatcar.github.io/sysext-bakery/docker_compose/
|
|
|
|
|
- name: systemd-sysupdate.timer
|
|
|
|
@ -63,6 +86,12 @@ storage:
|
|
|
|
|
- path: /app
|
|
|
|
|
local: app
|
|
|
|
|
files:
|
|
|
|
|
- path: /restic-password
|
|
|
|
|
contents:
|
|
|
|
|
local: restic-password
|
|
|
|
|
- path: /restic-env
|
|
|
|
|
contents:
|
|
|
|
|
local: restic-env
|
|
|
|
|
### docker-compose sysext
|
|
|
|
|
### https://flatcar.github.io/sysext-bakery/docker_compose/
|
|
|
|
|
- path: /opt/extensions/docker-compose/docker-compose-2.34.0-x86-64.raw
|
|
|
|
|