diff options
author | Philippe Mazet <philippe.mazet@nxp.com> | 2019-11-21 15:44:09 +0100 |
---|---|---|
committer | Philippe Mazet <philippe.mazet@nxp.com> | 2019-12-06 18:04:32 +0100 |
commit | 9783987dcc1b2b4935ea9c5d4ff7db443f0f7abe (patch) | |
tree | a40bd2138dd803545d8334cd028fe0927b523550 /backup.sh | |
parent | 87eff59f943ed44cc9d568602ed9e2756088398c (diff) |
backup.sh: avoid "file changed as we read it" error
In some case (long jobs), backup failed because some files were changed
during tar operation.
Diffstat (limited to 'backup.sh')
-rwxr-xr-x | backup.sh | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -24,7 +24,8 @@ docker exec -ti $DOCKERID gzip /tmp/db_lavaserver || exit $? docker cp $DOCKERID:/tmp/db_lavaserver.gz $BACKUP_DIR/ || exit $? docker exec -ti $DOCKERID rm /tmp/db_lavaserver.gz || exit $? -docker exec -ti $DOCKERID tar czf /root/joboutput.tar.gz /var/lib/lava-server/default/media/job-output/ || exit $? +# tar outputs warnings when file changes on disk while creating tar file. So do not "exit on error" +docker exec -ti $DOCKERID tar czf /root/joboutput.tar.gz /var/lib/lava-server/default/media/job-output/ || echo "WARNING: tar operation returned $?" docker cp $DOCKERID:/root/joboutput.tar.gz $BACKUP_DIR/ || exit $? docker exec -ti $DOCKERID rm /root/joboutput.tar.gz || exit $? |