compose-website/unit-files/b-u@.service

38 lines
968 B
SYSTEMD
Raw Normal View History

2015-09-18 11:42:29 +00:00
[Unit]
Description=Back up data from %i
[Service]
Type=oneshot
TimeoutStartSec=0
WorkingDirectory=/data/domains/%i/
EnvironmentFile=/etc/environment
2015-10-08 09:10:36 +00:00
ExecStartPre=-/bin/docker rm clean-%i
ExecStartPre=-/bin/docker rm backup-%i
2015-09-18 11:42:29 +00:00
ExecStartPre=/bin/bash -euxc ' \
/bin/docker run \
--rm \
--name clean-%i \
-e PASSPHRASE \
-v /root:/root \
indiepaas/duplicity \
remove-older-than 10D --force \
2015-10-08 09:10:50 +00:00
sftp://${BACKUP_DESTINATION}//data/%i'
2015-09-18 11:42:29 +00:00
ExecStartPre=/bin/bash -euxc '/data/domains/%i/BACKUP'
ExecStart=/bin/bash -euxc ' \
/bin/docker run \
--rm \
--name backup-%i \
-e PASSPHRASE \
-h backup.container \
--cpu-shares=40 \
2015-09-18 11:58:30 +00:00
-v /dev/random:/dev/random \
-v /dev/urandom:/dev/urandom \
2015-09-18 11:42:29 +00:00
-v /root:/root \
-v /data/domains/%i:/backup indiepaas/duplicity \
2015-09-18 11:58:30 +00:00
--volsize 500 \
--asynchronous-upload \
2015-09-18 11:42:29 +00:00
--encrypt-key ${ENCRYPT_KEY} \
/backup \
2015-10-08 09:10:50 +00:00
sftp://${BACKUP_DESTINATION}//data/%i'
2015-09-18 11:42:29 +00:00