Commit 3ce35e08 authored by Daniel Stan's avatar Daniel Stan

début de fonction de suppression

parent 9eadfcbf
......@@ -4,7 +4,12 @@ source "$(dirname $0)/backup_config.sh" || exit 1
available_local () {
# TODO escape
find $FS_DIR/$BACK_DIR -type d -printf "%P\n" | sed "s/\($PATTERN\)$/\1/; t; d"
find $FS_DIR/$BACK_DIR -type d -printf "%P\n" | sed "s/\($PATTERN\)$/\1/; t; d" | sort
}
can_delete () {
USED=$(find $FS_DIR/$BACK_DIR -lname "*/$1" -name "parent" -printf "%P\n" | sed "s/\/parent//")
echo "Used by $USED"
}
not_implemented () {
......@@ -39,5 +44,7 @@ elif [ "$1" = "receive" ]; then
fi
# Actual receive
cat > $path/gpg
elif [ "$1" = "can_delete" ]; then
can_delete $2
fi
......@@ -21,7 +21,11 @@ case "$(hostname)" in
BACK_DIR="$ORIGIN"
# Extra filter for volumes (sed syntax)
PATTERN=1d_.*
if [ "$ORIGIN" = "kugel" ]; then
PATTERN=quick_.*
else
PATTERN=1d_.*
fi
;;
*)
# Path to the backup fs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment