local old="`ls | head -n -$N_SNAPSHOT`"
if [ ! -z "$old" ]; then
echo "$(date): Removing oldest snapshot(s): $old..."
rm -rf "$old" || exit 669
fi
local old="`ls | head -n -$N_SNAPSHOT`"
if [ ! -z "$old" ]; then
echo "$(date): Removing oldest snapshot(s): $old..."
rm -rf "$old" || exit 669
fi
local newest=`ls | tail -n 1`
if [ -z "$newest" ]; then
echo "$(date): No previous snapshot found, performing a full backup!"
local newest=`ls | tail -n 1`
if [ -z "$newest" ]; then
echo "$(date): No previous snapshot found, performing a full backup!"
# Perhaps we could save time by recycling the oldest snapshot
cp -lR "$DEST/$newest" "$DEST/tmp" || exit 670
fi
# Perhaps we could save time by recycling the oldest snapshot
cp -lR "$DEST/$newest" "$DEST/tmp" || exit 670
fi
if (( `id -u` != 0 )); then { echo "Sorry, must be root. Exiting..."; exit; } fi
echo "$(date): START backup: $SRC -> $DEST"
if (( `id -u` != 0 )); then { echo "Sorry, must be root. Exiting..."; exit; } fi
echo "$(date): START backup: $SRC -> $DEST"