-
Notifications
You must be signed in to change notification settings - Fork 1
/
backup-data.sh
executable file
·46 lines (37 loc) · 1.06 KB
/
backup-data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
if [ -z "$1" ]
then
echo "No instance argument supplied"
echo "Usage: "$0" instance {start|stop|restart} [docker-compose options]"
exit 1
fi
set -o allexport
source config/$1.env
set +o allexport
case "$2" in
start)
echo "[--] Starting database backups for ${UO_INSTANCE}..."
docker-compose --project-name=${UO_INSTANCE} \
-f shared/backups/docker-compose.yml \
up -d "${@:3}"
echo " "
;;
stop)
echo "[--] Stopping database backups for ${UO_INSTANCE}..."
docker-compose --project-name=${UO_INSTANCE} \
-f shared/backups/docker-compose.yml \
down "${@:3}"
echo " "
;;
restart)
echo "[--] Restarting database backups for ${UO_INSTANCE}..."
docker-compose --project-name=${UO_INSTANCE} \
-f shared/backups/docker-compose.yml \
restart "${@:3}"
echo " "
;;
*)
echo "Usage: "$0" instance {start|stop|restart} [docker-compose options]"
exit 1
esac
exit 0