Advanced help output showing actual paths before step start
This commit is contained in:
@@ -40,10 +40,38 @@ step_1() {
|
||||
}
|
||||
|
||||
step_3_info() {
|
||||
echo "Backup [OPTION] <DIRECTORY> <TARGET> [EXCLUDES...]"
|
||||
echoinfo "Exclude path notation starts within DIRECTORY."
|
||||
echoinfo "e.g. to exclude DIRECTORY/a:"
|
||||
echoinfo " $0 budir DIRECTORY TARGET /a"
|
||||
# Backup single directory recursively
|
||||
local opt="[OPTION]"
|
||||
local dir="<DIRECTORY>"
|
||||
local tar="<TARGET>"
|
||||
local exc="[EXCLUDES...]"
|
||||
shift
|
||||
if [ "$1" == "-t" ] ; then
|
||||
opt=" -t "
|
||||
tar=
|
||||
shift
|
||||
fi
|
||||
if [ ! -z "$1" ] ; then
|
||||
dir="$1"
|
||||
shift
|
||||
if [ ! -z $tar ] && [ ! -z "$1" ] ; then
|
||||
tar="$1"
|
||||
shift
|
||||
else
|
||||
tar="$BACKUP_TARGET"
|
||||
fi
|
||||
if [ ! -z "$1" ] ; then
|
||||
exc="$@"
|
||||
else
|
||||
exc="[NO EXCLUDES]"
|
||||
fi
|
||||
fi
|
||||
echo "Backup $opt $dir $tar $exc"
|
||||
echoinfo " -t : Using configuration value as TARGET"
|
||||
echoinfo " <DIRECTORY> [EXCLUDES...]"
|
||||
echoinfo "EXCLUDES path notation starts within $dir"
|
||||
echoinfo "e.g. to exclude $dir/a:"
|
||||
echoinfo " $0 budir $dir $tar /a"
|
||||
}
|
||||
step_3_alias() { ALIAS="budir"; }
|
||||
step_3() {
|
||||
|
Reference in New Issue
Block a user