~ubuntu-branches/ubuntu/wily/duply/wily-proposed

« back to all changes in this revision

Viewing changes to duply

  • Committer: Package Import Robot
  • Author(s): Joachim Wiedorn
  • Date: 2015-07-18 18:02:42 UTC
  • mfrom: (1.2.13)
  • Revision ID: package-import@ubuntu.com-20150718180242-xgtpgzbflr31vu6e
Tags: 1.9.2-1
* New upstream release.
* Update manpage debian/man/duply.1.
* Update of all patches.
* Add new patch to change deprecated option of duplicity.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#  changed from ftplicity to duply.                                           #
10
10
#  See http://duply.net or http://ftplicity.sourceforge.net/ for more info.   #
11
11
#  (c) 2006 Christiane Ruetten, Heise Zeitschriften Verlag, Germany           #
12
 
#  (c) 2008-2014 Edgar Soldin (changes since version 1.3)                     #
 
12
#  (c) 2008-2015 Edgar Soldin (changes since version 1.3)                     #
13
13
###############################################################################
14
14
#  LICENSE:                                                                   #
15
15
#  This program is licensed under GPLv2.                                      #
22
22
ME_LONG="$0"
23
23
ME="$(basename $0)"
24
24
ME_NAME="${ME%%.*}"
25
 
ME_VERSION="1.9.1"
 
25
ME_VERSION="1.9.2"
26
26
ME_WEBSITE="http://duply.net"
27
27
 
28
28
# default config values
30
30
DEFAULT_TARGET='scheme://user[:password]@host[:port]/[/]path'
31
31
DEFAULT_TARGET_USER='_backend_username_'
32
32
DEFAULT_TARGET_PASS='_backend_password_'
 
33
DEFAULT_GPG='gpg'
33
34
DEFAULT_GPG_KEY='_KEY_ID_'
34
35
DEFAULT_GPG_PW='_GPG_PASSWORD_'
35
36
 
36
37
# function definitions ##########################
37
 
function set_config { # sets config vars
 
38
function set_config { # sets global config vars
38
39
  local CONFHOME_COMPAT="$HOME/.ftplicity"
39
40
  local CONFHOME="$HOME/.duply"
40
41
  local CONFHOME_ETC_COMPAT="/etc/ftplicity"
92
93
}
93
94
 
94
95
function using_info {
95
 
  duplicity_version_get
 
96
  lookup duplicity && duplicity_version_get
 
97
  local NOTFOUND="[not found]"
96
98
  # freebsd awk (--version only), debian mawk (-W version only), deliver '' so awk does not wait for input
97
 
  AWK_VERSION=$((awk --version '' 2>/dev/null || awk -W version '' 2>/dev/null) | awk '/.+/{sub(/^[Aa][Ww][Kk][ \t]*/,"",$0);print $0;exit}')
98
 
  PYTHON_VERSION=$(python -V 2>&1| awk '{print tolower($0);exit}')
99
 
  GPG_INFO=`gpg --version 2>/dev/null| awk '/^gpg/{v=$1" "$3};/^Home/{print v" ("$0")"}'`
100
 
  BASH_VERSION=$(bash --version | awk '/^GNU bash, version/{sub(/GNU bash, version[ ]+/,"",$0);print $0}')
101
 
  echo -e "Using installed duplicity version ${DUPL_VERSION:-(not found)}${PYTHON_VERSION+, $PYTHON_VERSION}\
102
 
${GPG_INFO:+, $GPG_INFO}${AWK_VERSION:+, awk '${AWK_VERSION}'}${BASH_VERSION:+, bash '${BASH_VERSION}'}."
 
99
  local AWK_VERSION=$( lookup awk && (awk --version '' 2>/dev/null || awk -W version '' 2>/dev/null) |\
 
100
                         awk '/.+/{sub(/^[Aa][Ww][Kk][ \t]*/,"",$0);print $0;exit}' \
 
101
                       || echo "[MISSING]" )
 
102
  local PYTHON_VERSION=$(lookup python && python -V 2>&1| awk '{print tolower($0);exit}' || echo "python $NOTFOUND" )
 
103
  local GPG_INFO=$(gpg_avail && gpg --version 2>&1| awk 'NR==1{v=$1" "$3};/^Home:/{print v" ("$0")"}' || echo "gpg $NOTFOUND")
 
104
  local BASH_VERSION=$(bash --version | awk 'NR==1{IGNORECASE=1;sub(/GNU bash, version[ ]+/,"",$0);print $0}')
 
105
  local GREP_VERSION=$(lookup grep && grep --version | awk 'NR==1{IGNORECASE=1;sub(/grep[ ]+/,"",$0);print $0}' || echo "$NOTFOUND")
 
106
  echo -e "Using installed duplicity version ${DUPL_VERSION:-$NOTFOUND}\
 
107
${PYTHON_VERSION+, $PYTHON_VERSION${PYTHONPATH:+ 'PYTHONPATH=$PYTHONPATH'}}\
 
108
${GPG_INFO:+, $GPG_INFO}${AWK_VERSION:+, awk '${AWK_VERSION}'}${GREP_VERSION:+, grep '${GREP_VERSION}'}\
 
109
${BASH_VERSION:+, bash '${BASH_VERSION}'}."
103
110
}
104
111
 
105
112
function usage_info { # print usage information
247
254
# NOTE: available since duplicity 0.6.14, translates to SIGN_PASSPHRASE
248
255
#GPG_PW_SIGN='<signpass>'
249
256
 
 
257
# uncomment and set a file path or name force duply to use this gpg executable
 
258
# available in duplicity 0.7.04 and above (currently unreleased 06/2015)
 
259
#GPG='/usr/local/gpg-2.1/bin/gpg'
 
260
 
250
261
# gpg options passed from duplicity to gpg process (default='')
251
262
# e.g. "--trust-model pgp|classic|direct|always" 
252
263
#   or "--compress-algo=bzip2 --bzip2-compress-level=9"
253
264
#   or "--personal-cipher-preferences AES256,AES192,AES..."
254
265
#   or "--homedir ~/.duply" - keep keyring and gpg settings duply specific
 
266
#   or "--pinentry-mode loopback" - needed for GPG 2.1+ _and_
 
267
#      also enable allow-loopback-pinentry in your .gnupg/gpg-agent.conf
255
268
#GPG_OPTS=''
256
269
 
257
270
# disable preliminary tests with the following setting
258
271
#GPG_TEST='disabled'
259
272
 
260
 
# credentials & server address of the backup target (URL-Format)
261
 
# syntax is
262
 
#   scheme://[user:password@]host[:port]/[/]path
263
 
# for details see duplicity manpage, section URL Format
264
 
#   http://duplicity.nongnu.org/duplicity.1.html#sect8
265
 
# probably one out of
266
 
#   # for cloudfiles backend user id is CLOUDFILES_USERNAME, password is 
267
 
#   # CLOUDFILES_APIKEY, you might need to set CLOUDFILES_AUTHURL manually
268
 
#   cf+http://[user:password@]container_name
269
 
#   dpbx:///some_dir
270
 
#   file://[relative|/absolute]/local/path
271
 
#   ftp[s]://user[:password]@other.host[:port]/some_dir
272
 
#   gdocs://user[:password]@other.host/some_dir
273
 
#   # for the google cloud storage (since duplicity 0.6.22)
274
 
#   # user/password are GS_ACCESS_KEY_ID/GS_SECRET_ACCESS_KEY
275
 
#   gs://bucket[/prefix] 
276
 
#   hsi://user[:password]@other.host/some_dir
277
 
#   imap[s]://user[:password]@host.com[/from_address_prefix]
278
 
#   mega://user[:password]@mega.co.nz/some_dir
279
 
#   rsync://user[:password]@host.com[:port]::[/]module/some_dir
280
 
#   # rsync over ssh (only keyauth)
281
 
#   rsync://user@host.com[:port]/[relative|/absolute]_path
282
 
#   # for the s3 user/password are AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY
283
 
#   s3://[user:password@]host/bucket_name[/prefix]
284
 
#   s3+http://[user:password@]bucket_name[/prefix]
285
 
#   # scp and sftp are aliases for the ssh backend
286
 
#   ssh://user[:password]@other.host[:port]/[/]some_dir
287
 
#   # for authenticated swift define TARGET_USER or SWIFT_USERNAME,
288
 
#   # TARGET_PASS or SWIFT_PASSWORD, SWIFT_AUTHURL (mandatory, the path to 
289
 
#   # your identity service, omitting leads to an error with swift),
290
 
#   # optionally SWIFT_AUTHVERSION (which defaults to "1")
291
 
#   swift://container_name
292
 
#   tahoe://alias/directory
293
 
#   webdav[s]://user[:password]@other.host/some_dir
294
 
# ATTENTION: characters other than A-Za-z0-9.-_.~ in the URL have 
295
 
#            to be replaced by their url encoded pendants, see
296
 
#            http://en.wikipedia.org/wiki/Url_encoding 
297
 
#            if you define the credentials as TARGET_USER, TARGET_PASS below 
298
 
#            duply will try to url_encode them for you if the need arises
 
273
# backend, credentials & location of the backup target (URL-Format)
 
274
# generic syntax is
 
275
#   scheme://[user[:password]@]host[:port]/[/]path
 
276
# eg.
 
277
#   sftp://bob:secret@backupserver.com//home/bob/dupbkp
 
278
# for details and available backends see duplicity manpage, section URL Format
 
279
#   http://duplicity.nongnu.org/duplicity.1.html#sect7
 
280
# NOTE:
 
281
#   some backends (eg. cloudfiles) need additional env vars to be set to
 
282
#   work properly, when in doubt consult the man page mentioned above.
 
283
# ATTENTION:
 
284
#   characters other than A-Za-z0-9.-_.~ in the URL have to be
 
285
#   replaced by their url encoded pendants, see
 
286
#     http://en.wikipedia.org/wiki/Url_encoding
 
287
#   if you define the credentials as TARGET_USER, TARGET_PASS below $ME
 
288
#   will try to url_encode them for you if the need arises.
299
289
TARGET='${DEFAULT_TARGET}'
300
290
# optionally the username/password can be defined as extra variables
301
291
# setting them here _and_ in TARGET results in an error
595
585
  return $CMD_ERR
596
586
}
597
587
 
 
588
# wrap grep to override possible env set GREP_OPTIONS=--color=always
 
589
function grep {
 
590
  command grep --color=never "$@"
 
591
}
 
592
 
 
593
# a lookup function for executables working with names or file paths
 
594
function lookup {
 
595
  local bin="$1"
 
596
  ( [ "${bin##*/}" == "$bin" ] && hash "$bin" 2>/dev/null ) || [ -x "$bin" ]
 
597
}
 
598
 
598
599
function qw { quotewrap "$@"; }
599
600
 
600
601
function quotewrap {
681
682
  var_isset 'PREVIEW' && local RUN=echo || local RUN=eval
682
683
$RUN ${DUPL_VARS_GLOBAL} ${BACKEND_PARAMS} \
683
684
 ${DUPL_PRECMD} duplicity $DUPL_CMD $DUPL_PARAMS_GLOBAL $(duplicity_params_conf)\
684
 
 $GPG_USEAGENT $DUPL_CMD_PARAMS ${PREVIEW:+}
 
685
 $GPG_USEAGENT $(gpg_custom_binary) $DUPL_CMD_PARAMS ${PREVIEW:+}
685
686
 
686
687
  local ERR=$?
687
688
  return $ERR
847
848
      FOUND=1
848
849
      
849
850
      CMD_MSG="Import keyfile '$FILE' to keyring"
850
 
      run_cmd "$GPG" $GPG_OPTS --batch --import "$FILE"
 
851
      run_cmd gpg $GPG_OPTS --batch --import "$FILE"
851
852
      if [ "$?" != "0" ]; then 
852
853
        warning "Import failed.${CMD_OUT:+\n$CMD_OUT}"
853
854
        ERR=1
863
864
 
864
865
  # try to set trust automagically
865
866
  CMD_MSG="Autoset trust of key '$KEY_ID' to ultimate"
866
 
  run_cmd echo $(gpg_fingerprint "$KEY_ID"):6: \| "$GPG" $GPG_OPTS --import-ownertrust --batch --logger-fd 1
 
867
  run_cmd echo $(gpg_fingerprint "$KEY_ID"):6: \| gpg $GPG_OPTS --import-ownertrust --batch --logger-fd 1
867
868
  if [ "$?" = "0" ] && [ -z "$PREVIEW" ]; then 
868
869
   # success on all levels, we're done
869
870
   return $ERR
874
875
with the command \"trust\" to \"ultimate\" (5) now.
875
876
Exit the edit mode of gpg with \"quit\"."
876
877
  CMD_MSG="Running gpg to manually edit key '$KEY_ID'"
877
 
  run_cmd sleep 5\; "$GPG" $GPG_OPTS --edit-key "$KEY_ID"
 
878
  run_cmd sleep 5\; gpg $GPG_OPTS --edit-key "$KEY_ID"
878
879
 
879
880
  return $ERR
880
881
}
881
882
 
882
883
# see 'How to specify a user ID' on gpg manpage
883
884
function gpg_fingerprint {
884
 
  local PRINT=$("$GPG" $GPG_OPTS --fingerprint "$1" 2>&1|awk -F= 'NR==2{gsub(/ /,"",$2);$2=toupper($2); if ( $2 ~ /^[A-F0-9]+$/ && length($2) == 40 ) print $2; else exit 1}') \
 
885
  local PRINT=$(gpg $GPG_OPTS --fingerprint "$1" 2>&1|awk -F= 'NR==2{gsub(/ /,"",$2);$2=toupper($2); if ( $2 ~ /^[A-F0-9]+$/ && length($2) == 40 ) print $2; else exit 1}') \
885
886
    && [ -n "$PRINT" ] && echo $PRINT && return 0
886
887
  return 1
887
888
}
896
897
      if [ ! -f "$FILE" ] && eval gpg_$(tolower $KEY_TYPE)_avail \"$KEY_ID\"; then
897
898
        # exporting
898
899
        CMD_MSG="Export $KEY_TYPE key '$KEY_ID'"
899
 
        run_cmd $GPG $GPG_OPTS --armor --export"$(test "SEC" = "$KEY_TYPE" && echo -secret-keys)"" $(qw $KEY_ID) >> \"$TMPFILE\""
 
900
        # gpg2.1 insists on passphrase here, gpg2.0- happily exports w/o it
 
901
        # we pipe an empty string when GPG_PW is not set to avoid gpg silently waiting for input
 
902
        run_cmd echo $(qw $GPG_PW) \| gpg $GPG_OPTS --passphrase-fd 0 --armor --export"$(test "SEC" = "$KEY_TYPE" && echo -secret-keys)"" $(qw $KEY_ID) >> \"$TMPFILE\""
900
903
        CMD_ERR=$?
901
904
 
902
905
        if [ "$CMD_ERR" = "0" ]; then
938
941
    return 255
939
942
  elif ! var_isset "$CACHE"; then
940
943
    if [ "$MODE" = "PUB" ]; then
941
 
      RES=$("$GPG" $GPG_OPTS --list-key "$KEYID" > /dev/null 2>&1; echo -n $?)
 
944
      RES=$(gpg $GPG_OPTS --list-key "$KEYID" > /dev/null 2>&1; echo -n $?)
942
945
    elif [ "$MODE" = "SEC" ]; then
943
 
      RES=$("$GPG" $GPG_OPTS --list-secret-key "$KEYID" > /dev/null 2>&1; echo -n $?)
 
946
      RES=$(gpg $GPG_OPTS --list-secret-key "$KEYID" > /dev/null 2>&1; echo -n $?)
944
947
    else
945
948
      return 255
946
949
    fi
1042
1045
  return $ERR
1043
1046
}
1044
1047
 
 
1048
function gpg_custom_binary {
 
1049
  var_isset GPG && [ "$GPG" != "$DEFAULT_GPG" ] &&\
 
1050
    echo "--gpg-binary $(qw "$GPG")"
 
1051
}
 
1052
 
 
1053
function gpg_binary {
 
1054
  local BIN
 
1055
  var_isset GPG && BIN="$GPG" || BIN="$DEFAULT_GPG"
 
1056
  echo "$BIN"
 
1057
}
 
1058
 
 
1059
function gpg_avail {
 
1060
  lookup $(gpg_binary)
 
1061
}
 
1062
 
 
1063
# enforce the use our selected gpg binary
 
1064
function gpg {
 
1065
  command $(gpg_binary) "$@"
 
1066
}
 
1067
export -f gpg
 
1068
 
1045
1069
# start of script #######################################################################
1046
1070
 
1047
1071
# confidentiality first, all we create is only readable by us
1051
1075
[ -n "$ME_LONG" ] && [ -x "$ME_LONG" ] || error "$ME missing. Executable & available in path? ($ME_LONG)"
1052
1076
 
1053
1077
if [ ${#@} -eq 1 ]; then
1054
 
        cmd="${1}"
 
1078
  cmd="${1}"
1055
1079
else
1056
 
        FTPLCFG="${1}" ; cmd="${2}"
 
1080
  FTPLCFG="${1}" ; cmd="${2}"
1057
1081
fi
1058
1082
 
1059
1083
# deal with command before profile validation calls
1093
1117
    exit 0
1094
1118
    ;;
1095
1119
  version|-version|--version|-v|-V)
 
1120
    # profile can override GPG, so import it if it was given
 
1121
    var_isset FTPLCFG && {
 
1122
      set_config
 
1123
      [ -r "$CONF" ] && . "$CONF" || warning "Cannot import config '$CONF'."
 
1124
    }
1096
1125
    version_info_using
1097
1126
    exit 0
1098
1127
    ;;
1116
1145
echo "Start $ME v$ME_VERSION, time is $(date_fix '%F %T')."
1117
1146
 
1118
1147
# check system environment
1119
 
DUPLICITY="$(which duplicity 2>/dev/null)"
1120
 
[ -z "$DUPLICITY" ] && error_path "duplicity missing. installed und available in path?"
 
1148
 
 
1149
# is duplicity avail
 
1150
lookup duplicity || error_path "duplicity missing. installed und available in path?"
1121
1151
# init, exec duplicity version check info
1122
1152
duplicity_version_get
1123
1153
duplicity_version_check
1124
1154
 
1125
 
[ -z "$(which awk 2>/dev/null)" ] && error_path "awk missing. installed und available in path?"
 
1155
# check for certain important helper programs
 
1156
for f in awk grep; do
 
1157
  lookup "$f" || \
 
1158
    error_path "$f missing. installed und available in path?"
 
1159
done
1126
1160
 
1127
1161
### read configuration
1128
1162
set_config
1189
1223
  }')
1190
1224
eval ${TARGET_SPLIT_URL}
1191
1225
 
1192
 
# check if backend specific software is in path
1193
 
[ -n "$(echo ${TARGET_URL_PROT} | grep -i -e '^ftp://$')" ] && \
1194
 
  [ -z "$(which ncftp 2>/dev/null)" ] && error_path "Protocol 'ftp' needs ncftp. Installed und available in path?" 
1195
 
[ -n "$(echo ${TARGET_URL_PROT} | grep -i -e '^ftps://$')" ] && \
1196
 
  [ -z "$(which lftp 2>/dev/null)" ] && error_path "Protocol 'ftps' needs lftp. Installed und available in path?"
1197
 
 
1198
1226
# fetch commmand from parameters ########################################################
1199
1227
# Hint: cmds is also used to check if authentification info sufficient in the next step 
1200
1228
cmds="$2"; shift 2
1306
1334
 
1307
1335
# GPG availability check (now we know if gpg is really needed)#################
1308
1336
if ! gpg_disabled; then 
1309
 
        GPG="$(which gpg 2>/dev/null)"
1310
 
        [ -z "$GPG" ] && error_path "gpg missing. installed und available in path?"
 
1337
  gpg_avail || error_path "gpg '$(gpg_binary)' missing. installed und available in path?"
1311
1338
fi
1312
1339
 
1313
 
 
1314
1340
# Output versions info ########################################################
1315
1341
using_info
1316
1342
 
1446
1472
 
1447
1473
# TODO: check for enough (async= upload space and WARN only
1448
1474
#       use function tmp_space 
1449
 
echo TODO: reimplent tmp space check
 
1475
#echo TODO: reimplent tmp space check
1450
1476
 
1451
1477
 
1452
1478
# test - GPG SANITY #####################################################################
1477
1503
  done
1478
1504
  # check encrypting
1479
1505
  CMD_MSG="Test - Encrypt to '$(join "','" "${GPG_KEYS_ENC_ARRAY[@]}")'${CMD_MSG_SIGN:+ & $CMD_MSG_SIGN}"
1480
 
  run_cmd $(gpg_pass_pipein GPG_PW_SIGN GPG_PW) $GPG $CMD_PARAM_SIGN $(gpg_param_passwd GPG_PW_SIGN GPG_PW) $CMD_PARAMS $GPG_USEAGENT --status-fd 1 $GPG_OPTS -o "${GPG_TEST}_ENC" -e "$ME_LONG"
 
1506
  run_cmd $(gpg_pass_pipein GPG_PW_SIGN GPG_PW) gpg $CMD_PARAM_SIGN $(gpg_param_passwd GPG_PW_SIGN GPG_PW) $CMD_PARAMS $GPG_USEAGENT --status-fd 1 $GPG_OPTS -o "${GPG_TEST}_ENC" -e "$ME_LONG"
1481
1507
  CMD_ERR=$?
1482
1508
 
1483
1509
  if [ "$CMD_ERR" != "0" ]; then 
1491
1517
  # check decrypting
1492
1518
  CMD_MSG="Test - Decrypt"
1493
1519
  gpg_key_decryptable || CMD_DISABLED="No matching secret key available."
1494
 
  run_cmd $(gpg_pass_pipein GPG_PW) "$GPG" $(gpg_param_passwd GPG_PW) $GPG_OPTS -o "${GPG_TEST}_DEC" $GPG_USEAGENT -d "${GPG_TEST}_ENC"
 
1520
  run_cmd $(gpg_pass_pipein GPG_PW) gpg $(gpg_param_passwd GPG_PW) $GPG_OPTS -o "${GPG_TEST}_DEC" $GPG_USEAGENT -d "${GPG_TEST}_ENC"
1495
1521
  CMD_ERR=$?
1496
1522
 
1497
1523
  if [ "$CMD_ERR" != "0" ]; then 
1502
1528
else
1503
1529
  # check encrypting
1504
1530
  CMD_MSG="Test - Encryption with passphrase${CMD_MSG_SIGN:+ & $CMD_MSG_SIGN}"
1505
 
  run_cmd $(gpg_pass_pipein GPG_PW) "$GPG" $GPG_OPTS $CMD_PARAM_SIGN --passphrase-fd 0 -o "${GPG_TEST}_ENC" --batch -c "$ME_LONG"
 
1531
  run_cmd $(gpg_pass_pipein GPG_PW) gpg $GPG_OPTS $CMD_PARAM_SIGN --passphrase-fd 0 -o "${GPG_TEST}_ENC" --batch -c "$ME_LONG"
1506
1532
  CMD_ERR=$?
1507
1533
  if [ "$CMD_ERR" != "0" ]; then 
1508
1534
    error_gpg_test "Encryption failed.${CMD_OUT:+\n$CMD_OUT}"
1510
1536
 
1511
1537
  # check decrypting
1512
1538
  CMD_MSG="Test - Decryption with passphrase"
1513
 
  run_cmd $(gpg_pass_pipein GPG_PW) "$GPG" $GPG_OPTS --passphrase-fd 0 -o "${GPG_TEST}_DEC" --batch -d "${GPG_TEST}_ENC"
 
1539
  run_cmd $(gpg_pass_pipein GPG_PW) gpg $GPG_OPTS --passphrase-fd 0 -o "${GPG_TEST}_DEC" --batch -d "${GPG_TEST}_ENC"
1514
1540
  CMD_ERR=$?
1515
1541
  if [ "$CMD_ERR" != "0" ]; then 
1516
1542
    error_gpg_test "Decryption failed.${CMD_OUT:+\n$CMD_OUT}"
1702
1728
# user info
1703
1729
echo; separator "Start running command $(toupper $cmd) at $(date_from_nsecs $RUN_START)"
1704
1730
 
 
1731
# with duplicity v0.7.03 old option exclude-globbing-filelist
 
1732
# is deprecated in favour of option exclude-filelist
 
1733
GLOBB="--exclude-filelist"
 
1734
DUBV=$(duplicity -V | cut -d' ' -f2)
 
1735
if [ -n "$DUBV" ]; then
 
1736
  DUBVA=$(echo "$DUBV" | cut -d'.' -f1)
 
1737
  DUBVB=$(echo "$DUBV" | cut -d'.' -f2)
 
1738
  DUBVC=$(echo "$DUBV" | cut -d'.' -f3)
 
1739
  if [ $DUBVA -eq 0 -a $DUBVB -eq 6 ]; then
 
1740
    GLOBB="--exclude-globbing-filelist"
 
1741
  elif [ $DUBVA -eq 0 -a $DUBVB -eq 7 ]; then
 
1742
    if [ $(($DUBVC + 0)) -le 2 ]; then
 
1743
      GLOBB="--exclude-globbing-filelist"
 
1744
    fi
 
1745
  fi
 
1746
fi
 
1747
 
1705
1748
case "$(tolower $cmd)" in
1706
1749
  'pre'|'post')
1707
1750
    if [ "$cmd" == 'pre' ]; then
1713
1756
    ( run_script "$script" )
1714
1757
    ;;
1715
1758
  'bkp')
1716
 
    duplify -- "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \
 
1759
    duplify -- "${dupl_opts[@]}" $GLOBB "$EXCLUDE" \
1717
1760
          "$SOURCE" "$BACKEND_URL"
1718
1761
    ;;
1719
1762
  'incr')
1720
 
    duplify incr -- "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \
 
1763
    duplify incr -- "${dupl_opts[@]}" $GLOBB "$EXCLUDE" \
1721
1764
          "$SOURCE" "$BACKEND_URL"
1722
1765
    ;;
1723
1766
  'full')
1724
 
    duplify full -- "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \
 
1767
    duplify full -- "${dupl_opts[@]}" $GLOBB "$EXCLUDE" \
1725
1768
          "$SOURCE" "$BACKEND_URL"
1726
1769
    ;;
1727
1770
  'verify')
1728
1771
    TIME="${ftpl_pars[0]:+"-t ${ftpl_pars[0]}"}"
1729
 
    duplify verify -- $TIME "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \
 
1772
    duplify verify -- $TIME "${dupl_opts[@]}" $GLOBB "$EXCLUDE" \
1730
1773
          "$BACKEND_URL" "$SOURCE"
1731
1774
    ;;
1732
1775
  'verifypath')
1737
1780
  Hint: 
1738
1781
    Syntax is -> $ME <profile> verifyPath <rel_bkp_path> <local_path> [<age>]"
1739
1782
 
1740
 
    duplify verify -- $TIME "${dupl_opts[@]}" --exclude-globbing-filelist "$EXCLUDE" \
 
1783
    duplify verify -- $TIME "${dupl_opts[@]}" $GLOBB "$EXCLUDE" \
1741
1784
          --file-to-restore "$IN_PATH" "$BACKEND_URL" "$OUT_PATH"
1742
1785
    ;;
1743
1786
  'list')
1799
1842
esac
1800
1843
 
1801
1844
CMD_ERR=$?
1802
 
RUN_END=$(date_fix %s)$(nsecs) ; RUNTIME=$(( $RUN_END - $RUN_START ))
 
1845
RUN_END=$(date_fix %s)$(nsecs)
 
1846
RUNTIME=$(( $RUN_END - $RUN_START ))
1803
1847
 
1804
1848
# print message on error; set error code
1805
1849
if [ "$CMD_ERR" -ne 0 ]; then