Ignore directories of users who don't have anything to back up

This commit is contained in:
Salt 2020-06-30 07:08:09 -05:00
parent 2b8cf96cfe
commit 19908fea0b

View File

@ -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