diff --git a/seqs/backup.sh b/seqs/backup.sh index 702b90a..f331e6e 100755 --- a/seqs/backup.sh +++ b/seqs/backup.sh @@ -40,10 +40,38 @@ step_1() { } step_3_info() { - echo "Backup [OPTION] [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="" + local tar="" + 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 " [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() {