fi
done
+Usage() {
+ echo "Usage: $NAME [-q|--quick] [<system> [<system> [...]]]"
+ echo " $NAME {-r|--running}"
+ exit 2
+}
+
Check_Size() {
# $1: directory
# $2: padding
if [ -n "$pid" ]; then
if kill -0 "$pid" >/dev/null 2>&1; then
echo "Backup job running with PID $pid."
+ echo
+ pstree -ap "$pid" 2>/dev/null
exit 0
else
echo "No backup running (invalid PID $pid in \"$PIDFILE\")."
exit 1
fi
-if [ "$1" == "-q" ]; then
- QUICK=1
+while [ $# -gt 0 ]; do
+ case "$1" in
+ "--quick"|"-q")
+ QUICK=1
+ ;;
+ "-"*)
+ Usage
+ ;;
+ *)
+ break
+ esac
shift
-fi
-
-case "$1" in
- "-"*)
- echo "Usage: $NAME [-q] [<system> [<system> [...]]]"
- echo " $NAME {-r|--running}"
- exit 2
- ;;
-esac
+done
if [ $# -ge 1 ]; then
for s in "$@"; do
echo "- Target: $target"
if [ $generations -gt 0 ]; then
- for s in $target/current $target/[0-9]*-[0-9]*; do
+ for s in $target/[0-9]*-[0-9]* $target/current; do
[ -e "$s" ] || continue
echo " - Snapshot: $s"
Check_Size "$s" " "