summaryrefslogtreecommitdiffstats
path: root/lava-master/scripts/setup.sh
diff options
context:
space:
mode:
authorkhilman <khilman@users.noreply.github.com>2018-12-11 19:43:43 -0800
committerGitHub <noreply@github.com>2018-12-11 19:43:43 -0800
commita139c6ac3aa56a4bbfbd3a334141817de496c2dd (patch)
tree0745edfd213533ffcf8d38529c39a9a3fad9de6d /lava-master/scripts/setup.sh
parentdbb6b647fc421fb9c70620e2fe725cc5546c0702 (diff)
parent290612eef95ffca9b6c9a28224be6f51c55bddcd (diff)
Merge pull request #80 from montjoie/backup
Cleanup and fix backup/restore process
Diffstat (limited to 'lava-master/scripts/setup.sh')
-rwxr-xr-xlava-master/scripts/setup.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh
index 34cd0a1..6153c9d 100755
--- a/lava-master/scripts/setup.sh
+++ b/lava-master/scripts/setup.sh
@@ -7,18 +7,25 @@ fi
sudo -u postgres psql -c "ALTER USER lavaserver WITH PASSWORD '$(cat /root/pg_lava_password)';" || exit $?
sed -i "s,^LAVA_DB_PASSWORD=.*,LAVA_DB_PASSWORD='$(cat /root/pg_lava_password)'," /etc/lava-server/instance.conf || exit $?
-if [ -e /db_lavaserver.gz ];then
- gunzip /db_lavaserver.gz || exit $?
+if [ -e /root/backup/db_lavaserver.gz ];then
+ gunzip /root/backup/db_lavaserver.gz || exit $?
fi
-if [ -e /db_lavaserver ];then
+if [ -e /root/backup/db_lavaserver ];then
echo "Restore database from backup"
- sudo -u postgres psql < /db_lavaserver || exit $?
+ sudo -u postgres psql < /root/backup/db_lavaserver || exit $?
lava-server manage migrate || exit $?
echo "Restore jobs output from backup"
rm -r /var/lib/lava-server/default/media/job-output/*
- tar xzf /joboutput.tar.gz || exit $?
+ tar xzf /root/backup/joboutput.tar.gz || exit $?
fi
+
+if [ -e /root/backup/devices.tar.gz ];then
+ echo "INFO: Restoring devices files"
+ tar xzf /root/backup/devices.tar.gz
+ chown -R lavaserver:lavaserver /etc/lava-server/dispatcher-config/devices
+fi
+
chown -R lavaserver:lavaserver /var/lib/lava-server/default/media/job-output/
# default site is set as example.com