summaryrefslogtreecommitdiffstats
path: root/backup.sh
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2018-12-11 10:02:54 +0100
committerCorentin LABBE <clabbe@baylibre.com>2018-12-11 10:13:27 +0100
commit290612eef95ffca9b6c9a28224be6f51c55bddcd (patch)
tree0745edfd213533ffcf8d38529c39a9a3fad9de6d /backup.sh
parent5787bbd116b65d4be872dcca76d0049899a53a2d (diff)
backup: backup also devices files
The current way to do backup assume that slave will be restarted after each master maintainance. If master is restarted from backup without slaves restarting bring to devices files missing. By backuping devices, a master can be restored from backup without needing slaves worker to be restarted.
Diffstat (limited to 'backup.sh')
-rwxr-xr-xbackup.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/backup.sh b/backup.sh
index 3477367..f4cf1de 100755
--- a/backup.sh
+++ b/backup.sh
@@ -9,6 +9,10 @@ DOCKERID=$(docker ps |grep master | cut -d' ' -f1)
if [ -z "$DOCKERID" ];then
exit 1
fi
+
+docker exec -ti $DOCKERID tar czf /root/devices.tar.gz /etc/lava-server/dispatcher-config/devices/ || exit $?
+docker cp $DOCKERID:/root/devices.tar.gz $BACKUP_DIR/ || exit $?
+
# for an unknown reason pg_dump > file doesnt work
docker exec -ti $DOCKERID sudo -u postgres pg_dump --create --clean lavaserver --file /tmp/db_lavaserver || exit $?
docker exec -ti $DOCKERID gzip /tmp/db_lavaserver || exit $?