diff --git a/contrib/backup/functions b/contrib/backup/functions index 9ed8ec534..e72d31e4a 100644 --- a/contrib/backup/functions +++ b/contrib/backup/functions @@ -42,7 +42,7 @@ function backup_db () { if [ "${DB_ADAPTER}" == "mysql2" ]; then mysqldump --opt --single-transaction -u${DB_USER} -p${DB_PASS} ${DB_NAME} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.mysql.gz elif [ "${DB_ADAPTER}" == "postgresql" ]; then - su -c "pg_dump ${DB_NAME} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz" postgres + su -c "pg_dump -c ${DB_NAME} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz" postgres else echo "DB ADAPTER not found. if its sqlite backup is already saved in filebackup" fi @@ -147,10 +147,10 @@ function restore_zammad () { if [ "${DB_ADAPTER}" == "postgresql" ]; then echo "# Restoring PostgrSQL DB" - gunzip < ${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz | pg_restore -c ${DB_NAME} + gunzip -ck < ${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz | su -c "psql -d ${DB_NAME}" postgres elif [ "${DB_ADAPTER}" == "mysql2" ]; then echo "# Restoring MySQL DB" - gunzip < ${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz | mysql -u${DB_USER} -p${DB_PASS} ${DB_NAME} + gunzip -ck < ${BACKUP_DIR}/${RESTORE_DB_DATE}_zammad_db.${DB_FILE_EXT}.gz | mysql -u${DB_USER} -p${DB_PASS} ${DB_NAME} fi } diff --git a/contrib/backup/zammad_restore.sh b/contrib/backup/zammad_restore.sh index c0f986b4d..ac04ed7fb 100755 --- a/contrib/backup/zammad_restore.sh +++ b/contrib/backup/zammad_restore.sh @@ -16,8 +16,6 @@ restore_warning "${1}" check_database_config_exists -get_db_credentials - get_restore_dates choose_restore_date "${1}"