From 19908fea0b1070f388118049556c8b69afa34457 Mon Sep 17 00:00:00 2001 From: Salt Date: Tue, 30 Jun 2020 07:08:09 -0500 Subject: [PATCH] Ignore directories of users who don't have anything to back up --- roles/desktop/templates/backup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/desktop/templates/backup.sh b/roles/desktop/templates/backup.sh index 60156ce..e450f28 100644 --- a/roles/desktop/templates/backup.sh +++ b/roles/desktop/templates/backup.sh @@ -36,6 +36,7 @@ fi # WE MAKE BACKUP NOW SERGEI for dir in /home/*; do username="$(basename -- "$dir")" + [ -d "$dir/.backup" ] || continue tar czhf "$OUTDIR/desktop-$username-{{ inventory_hostname }}-$(date -Iseconds).tar.gz" "$dir/.backup/"* done