From 0d60e156e2794bd59e533f216f6a08a8eb74e053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sun, 12 Feb 2017 15:01:21 +0100 Subject: [PATCH] use tar --overwrite instead of deleting zammad dir --- contrib/backup/functions | 7 +------ contrib/backup/zammad_restore.sh | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/contrib/backup/functions b/contrib/backup/functions index f3d944789..076e76568 100644 --- a/contrib/backup/functions +++ b/contrib/backup/functions @@ -141,14 +141,9 @@ function stop_zammad () { ${INIT_CMD} stop zammad } -function delete_current_files () { - echo "# Deleting Zammad dir ${ZAMMAD_DIR}" - test -d ${ZAMMAD_DIR} && rm -rf ${ZAMMAD_DIR} -} - function restore_zammad () { echo "# Restoring Files" - tar -C / -xzf ${BACKUP_DIR}/${RESTORE_FILE_DATE}_zammad_files.tar.gz + tar -C / --overwrite -xzf ${BACKUP_DIR}/${RESTORE_FILE_DATE}_zammad_files.tar.gz if [ "${DB_ADAPTER}" == "postgresql" ]; then echo "# Restoring PostgrSQL DB" diff --git a/contrib/backup/zammad_restore.sh b/contrib/backup/zammad_restore.sh index 5db01df59..c0f986b4d 100755 --- a/contrib/backup/zammad_restore.sh +++ b/contrib/backup/zammad_restore.sh @@ -26,8 +26,6 @@ detect_initcmd stop_zammad -delete_current_files - restore_zammad start_zammad