Skip to content

Instantly share code, notes, and snippets.

@1player
Created February 18, 2024 11:11
Show Gist options
  • Save 1player/9ddf1b7993395fae87221a01e5c3505f to your computer and use it in GitHub Desktop.
Save 1player/9ddf1b7993395fae87221a01e5c3505f to your computer and use it in GitHub Desktop.
# Ansible managed
[Unit]
After=network-online.target
[Container]
ContainerName=backup
Image=docker.io/mazzolino/restic
HostName=xxx
Environment="RUN_ON_STARTUP=true"
Environment="RESTIC_REPOSITORY=sftp:xxx@xxx.rsync.net:restic-xxx/"
Environment="RESTIC_BACKUP_ARGS=--files-from=/backup/backup.include"
Environment="RESTIC_FORGET_ARGS=--prune --keep-last 7 --keep-daily 7 --keep-weekly 4 --keep-monthly 3 --keep-yearly 1 --keep-tag keep --host xxx"
Environment="BACKUP_CRON=0 30 4 * * *"
Environment="RESTIC_CHECK_ARGS=--read-data-subset 10%"
Environment="POST_COMMANDS_SUCCESS=curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/xxx"
Secret=backup-restic-password,type=env,target=RESTIC_PASSWORD
Volume=/etc/backup.include:/backup/backup.include
Volume=/etc:/backup/etc
Volume=/srv:/backup/srv
Volume=backup-ssh.volume:/run/secrets/.ssh:ro
[Install]
WantedBy=multi-user.target default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment