From aa8f6aadd5651afc4e2e7d2fd444a33e735e5ee4 Mon Sep 17 00:00:00 2001 From: Lutz Reinhardt Date: Wed, 9 May 2018 09:11:40 +0200 Subject: [PATCH 1/2] suppress tar warning suppress "tar: Removing leading `/' from member names" warning --- contrib/backup/functions | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/backup/functions b/contrib/backup/functions index e3d807199..164fdd4d5 100644 --- a/contrib/backup/functions +++ b/contrib/backup/functions @@ -40,7 +40,14 @@ function backup_dir_create () { function backup_files () { echo "creating file backup..." - tar -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${ZAMMAD_DIR} + SRC="${ZAMMAD_DIR}" + ARGS="" + # remove leading "/" to suppress the tar warning + if [[ "${ZAMMAD_DIR}" =~ ^/ ]]; then + SRC="${ZAMMAD_DIR:1}" + ARGS="-C /" + fi + tar ${ARGS} -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${SRC} ln -sfn ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${BACKUP_DIR}/latest_zammad_files.tar.gz } From 7667b98d0597990e2cc7d9af29519ec85964ef13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 9 May 2018 17:13:08 +0200 Subject: [PATCH 2/2] Update functions --- contrib/backup/functions | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/contrib/backup/functions b/contrib/backup/functions index 164fdd4d5..32415b99d 100644 --- a/contrib/backup/functions +++ b/contrib/backup/functions @@ -40,14 +40,7 @@ function backup_dir_create () { function backup_files () { echo "creating file backup..." - SRC="${ZAMMAD_DIR}" - ARGS="" - # remove leading "/" to suppress the tar warning - if [[ "${ZAMMAD_DIR}" =~ ^/ ]]; then - SRC="${ZAMMAD_DIR:1}" - ARGS="-C /" - fi - tar ${ARGS} -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${SRC} + tar -C / -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${ZAMMAD_DIR#/} ln -sfn ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${BACKUP_DIR}/latest_zammad_files.tar.gz }