local exclude
- exclude='total '
+ exclude=' \.$'
if [[ "$dir_name" == "/" ]]; then
exclude="$exclude"'| \.stamp$| dev$| etc$| proc$| root$| run$| sys$| tmp$'
exclude="$exclude"'| data$| net$| srv$'
fi
# shellcheck disable=SC2012
- ls -Al "$base_dir$dir_name" 2>/dev/null \
- | egrep -v "($exclude)" | awk '!($2="")' | column -t
+ find "$base_dir$dir_name". -maxdepth 1 -printf '%M %10u:%-10g %t %12s %f\n' 2>/dev/null \
+ | LC_ALL=C sort -k 9 | grep -Ev "($exclude)"
}
HandleSystem() {
# shellcheck source=/dev/null
source "$latest_d/.stamp"
- if [[ $code -ne 0 && $code -ne 24 ]]; then
- echo "Last backup generation has errors, skipping system!"
- echo; return 1
+ if [[ $code -ne 0 ]]; then
+ echo "Warning: Last backup generation had errors, code $code!"
fi
# Search previous generation without errors
/etc/systemd/network/ \
/etc/systemd/system/ \
/etc/systemd/user/ \
+ /lib/systemd/network/ \
+ /lib/systemd/system/ \
+ /usr/lib/systemd/network/ \
+ /usr/lib/systemd/user/ \
/var/log/dumps/ \
; do
[[ ! -d "${gen1_d}${dir}" ]] && continue