duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Duplicity-talk] The awk command that strips the --exclude and --include


From: Rob Adair 'Profitable Business Systems'
Subject: [Duplicity-talk] The awk command that strips the --exclude and --include parameters from DUPL_PARAMS fails to remove a one byte parameter value.
Date: Thu, 19 Apr 2018 14:39:19 -0500 (CDT)

original:

function duplicity_params_conf {
  # reuse cmd var from main loop
  ## in/exclude parameters are currently not supported on restores
  if [ "$cmd" = "fetch" ] || [ "$cmd" = "restore" ] || [ "$cmd" = "status" ]; then
    # filter exclude params from fetch/restore
                                                                               vvv
    echo "$DUPL_PARAMS" | awk '{gsub(/--(ex|in)clude[a-z-]*(([ \t]+|=)[^-][^ \t]+)?/,"");print}'
    return
  fi
  
  echo "$DUPL_PARAMS"
}


function duplicity_params_conf {
  # reuse cmd var from main loop
  ## in/exclude parameters are currently not supported on restores
  if [ "$cmd" = "fetch" ] || [ "$cmd" = "restore" ] || [ "$cmd" = "status" ]; then
    # filter exclude params from fetch/restore
                                                                               vvv
    echo "$DUPL_PARAMS" | awk '{gsub(/--(ex|in)clude[a-z-]*(([ \t]+|=)[^-][^ \t]*)?/,"");print}'
    return
  fi
  
  echo "$DUPL_PARAMS"
}


DUPL_PARAMS="$DUPL_PARAMS --include /etc --include /home --include /opt/zimbra/backup --exclude /"

duply failed to remove the / after --exclude.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]