This commit is contained in:
Your Name 2015-06-13 19:00:55 +00:00
parent aa1d78b9e1
commit 2b1bef9110
2 changed files with 22 additions and 0 deletions

View file

@ -8,6 +8,8 @@ EnvironmentFile=/etc/environment
ExecStartPre=/usr/bin/docker run --rm -v /opt/bin:/opt/bin ibuildthecloud/systemd-docker ExecStartPre=/usr/bin/docker run --rm -v /opt/bin:/opt/bin ibuildthecloud/systemd-docker
ExecStartPre=-/usr/bin/docker kill mysqldump-%i ExecStartPre=-/usr/bin/docker kill mysqldump-%i
ExecStartPre=-/usr/bin/docker rm mysqldump-%i ExecStartPre=-/usr/bin/docker rm mysqldump-%i
ExecStartPre=-/usr/bin/docker rm clean-%i
ExecStartPre=-/usr/bin/docker rm backup-%i
ExecStartPre=/bin/bash -euxc ' \ ExecStartPre=/bin/bash -euxc ' \
/bin/docker run \ /bin/docker run \
--rm \ --rm \

20
utils/spread_backups.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash -eux
for unit in `systemctl list-units --all backup@*service | grep "Back up data" | cut -d" " -f2 | grep backup | sort -R`
do
systemctl stop $unit
systemctl restart $unit
done
for unit in `systemctl list-units --all backup@*service | grep "Back up data" | cut -d" " -f3 | grep backup | sort -R`
do
systemctl stop $unit
systemctl restart $unit
done
for unit in `systemctl list-units --all backup@*service | grep "Back up data" | cut -d" " -f1 | grep backup | sort -R`
do
systemctl stop $unit
systemctl restart $unit
done