logcompressor: xz-support (-x). logmanager: "no config found"-message

This commit is contained in:
Denis Knauf 2012-07-11 11:21:12 +02:00
parent 2c1850e454
commit 20a02be1fc
2 changed files with 11 additions and 3 deletions

View file

@ -2,15 +2,16 @@
help() { help() {
cat <<EOF cat <<EOF
Usage: `basename "$0"` -h | [-n] DIR [DIR [...]] Usage: `basename "$0"` -h | [-n] [-g|-b|-l|-x|-c PACKER] DIR [DIR [...]]
Komprimiert alle Dateien in DIR/archive. Komprimiert alle Dateien in DIR/archive.
-n Trockenlauf -n Trockenlauf
Packer: -g: gzip, -b: bzip2, -l: lzma, -x: xz, -c PACKER: einen anderen.
EOF EOF
exit exit
} }
[ 0 -lt $# ] || help [ 0 -lt $# ] || help
x=`getopt he:ngblc: "$@"` || exit 1 x=`getopt he:ngblxc: "$@"` || exit 1
eval set -- $x eval set -- $x
p=gzip p=gzip
@ -25,6 +26,7 @@ do
-g) p=gzip ;; -g) p=gzip ;;
-b) p=bzip2 ;; -b) p=bzip2 ;;
-l) p=lzma ;; -l) p=lzma ;;
-x) p=xz ;;
-c) p="$1" ; shift ;; -c) p="$1" ; shift ;;
esac esac
done done
@ -34,5 +36,5 @@ done
for d for d
do do
find "$d" -name archive -type d -exec sh -c ' find "$d" -name archive -type d -exec sh -c '
find "$1" -type f ! -name "*.bz2" ! -name "*.gz" ! -name "*.lzma" -exec '"$n"' '"$p"' -- "{}" \;' -- '{}' \; find "$1" -type f ! -name "*.bz2" ! -name "*.gz" ! -name "*.lzma" ! -name "*.xz" -exec '"$n"' '"$p"' -- "{}" \;' -- '{}' \;
done done

View file

@ -46,6 +46,12 @@ do
fi fi
done done
if [ ! -r "$c" ]
then
echo "No config found." >&2
exit 1
fi
# Format: Verzeichnis [Ausdruck[,Ausdruck[,...]] [Aufbewahrungszeit]] # Format: Verzeichnis [Ausdruck[,Ausdruck[,...]] [Aufbewahrungszeit]]
# Verzeichnisse duerfen nur einmalig Vorkommen # Verzeichnisse duerfen nur einmalig Vorkommen
sed -ne 's/#.*//;/\//p' "$c" | while read dir exp age opts sed -ne 's/#.*//;/\//p' "$c" | while read dir exp age opts