diff options
author | khilman <khilman@users.noreply.github.com> | 2018-12-11 19:43:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-11 19:43:43 -0800 |
commit | a139c6ac3aa56a4bbfbd3a334141817de496c2dd (patch) | |
tree | 0745edfd213533ffcf8d38529c39a9a3fad9de6d /backup.sh | |
parent | dbb6b647fc421fb9c70620e2fe725cc5546c0702 (diff) | |
parent | 290612eef95ffca9b6c9a28224be6f51c55bddcd (diff) |
Merge pull request #80 from montjoie/backup
Cleanup and fix backup/restore process
Diffstat (limited to 'backup.sh')
-rwxr-xr-x | backup.sh | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 $? @@ -20,4 +24,5 @@ docker cp $DOCKERID:/root/joboutput.tar.gz $BACKUP_DIR/ || exit $? docker exec -ti $DOCKERID rm /root/joboutput.tar.gz || exit $? echo "Backup done in $BACKUP_DIR" +rm -f backup-latest ln -sf $BACKUP_DIR backup-latest |