From 47d55cff76206530588a10321106fb7ea3b6c5ba Mon Sep 17 00:00:00 2001 From: N1ebieski Date: Fri, 24 Feb 2023 11:52:37 +0100 Subject: [PATCH] Update v-backup-user Include "hidden" files to backup with support for exclusions in old pattern --- bin/v-backup-user | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/v-backup-user b/bin/v-backup-user index e2d7cac9..0db5d376 100755 --- a/bin/v-backup-user +++ b/bin/v-backup-user @@ -251,6 +251,11 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then if [ ! -z "$exlusion" ]; then xdirs="$(echo -e "$exlusion" |tr ':' '\n' |grep -v $domain)" for xpath in $xdirs; do + # Add ./ at the beginning of the path if the path is in old pattern + if [[ $xpath != ./* ]]; then + xpath=(./$xpath) + fi + if [ -d "$xpath" ]; then fargs+=(--exclude=$xpath/*) echo "$(date "+%F %T") excluding directory $xpath" @@ -265,7 +270,7 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB" != '*' ]; then set +f # Backup files - tar --anchored -cpf- ${fargs[@]} * |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz + tar --anchored -cpf- ${fargs[@]} --exclude={'./','../'} . |gzip -$BACKUP_GZIP - > $tmpdir/web/$domain/domain_data.tar.gz done # Print total