3 # backup-script system for cloning systems using rsync
4 # Copyright (c)2008-2013 Alexander Barton, alex@barton.de
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 # Please read the file COPYING, README and AUTHORS for more information.
14 CONF_D="/etc/backup-script.d"
24 if [ "$1" == "-q" ]; then
31 echo "Usage: $NAME [-p] [<system> [<system> [...]]]"
38 if [ ! -r "${CONF_D}/$s" ]; then
39 echo "$NAME: Can' read \"${CONF_D}/$s\"!"
42 sys="$sys ${CONF_D}/$s"
48 [ -r "${CONF_D}/backup-script.conf" ] && source "${CONF_D}/backup-script.conf"
51 [ -r "$f" -a -f "$f" ] || continue
54 target="$default_target"
57 "backup-script.conf"|*.sh)
62 # Read in configuration file
66 target="$target/$system"
68 [ -d "$target" ] || continue
71 echo "- Target: $target"
72 if [ "$QUICK" = "0" ]; then
73 size=`du -sh "$target" | cut -f1`
76 if [ -f "$target/.stamp" ]; then
77 last=`stat "$target/.stamp" | grep "^Modify: " | cut -d':' -f2- | cut -d. -f1`
78 [ -n "$last" ] && echo "- Date:" $last
80 source "$target/.stamp"
81 [ -n "$code" ] && echo "- Result code:" $code
83 echo "- No timestamp recorded!?"
90 if [ $count -lt 1 ]; then
91 echo "No backups found!"
94 echo "$count system backup(s) found."