Ignore .backup directories that don't have anything in them
This commit is contained in:
parent
19908fea0b
commit
efd22958a3
@ -37,6 +37,7 @@ fi
|
|||||||
for dir in /home/*; do
|
for dir in /home/*; do
|
||||||
username="$(basename -- "$dir")"
|
username="$(basename -- "$dir")"
|
||||||
[ -d "$dir/.backup" ] || continue
|
[ -d "$dir/.backup" ] || continue
|
||||||
|
for file in "$dir/.backup/"*; do [ -e "$file" ] || continue; done
|
||||||
tar czhf "$OUTDIR/desktop-$username-{{ inventory_hostname }}-$(date -Iseconds).tar.gz" "$dir/.backup/"*
|
tar czhf "$OUTDIR/desktop-$username-{{ inventory_hostname }}-$(date -Iseconds).tar.gz" "$dir/.backup/"*
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user