From 23f67e7cd29cf02c232559d17fc51e115b87a6c5 Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Sun, 29 Oct 2017 16:45:12 +0100 Subject: [PATCH] Fixes backup backuping itself #1563 --- lgsm/functions/command_backup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 586a7db99..4225a2c5e 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -112,7 +112,8 @@ fn_backup_compression(){ sleep 2 fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..." fn_script_log_info "backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" - tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${backupdir}" ./* + excludedir=$(realpath --relative-to="${rootdir}" "${backupdir}") + tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" ./* local exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol