s4-dns: dlz_bind9: Fix ipv6 updates
[samba.git] / source3 / script / smbtar
index f04eddc32badc49717b01c72ad8d215a4652ad34..67a794553cf5349eb868eeab15ec02636b8e4d07 100644 (file)
@@ -30,7 +30,9 @@ username=$LOGNAME           # Default: same user name as in *nix
 verbose="2>/dev/null"        # Default: no echo to stdout
 log="-d 2"
 newer=""
+newerarg=""
 blocksize=""
+blocksizearg=""
 clientargs="-c 'tarmode full'"
 tarcmd="c"
 tarargs=""
@@ -62,7 +64,7 @@ Options:         (Description)                 (Default)
   exit $ex
 }
 
-echo Params count: $#
+echo Params count: $#
 
 # DEC OSF AKA Digital UNIX does not seem to return a value in OPTIND if 
 # there are no command line params, so protect us against that ...
@@ -78,7 +80,8 @@ while getopts riavl:b:d:N:s:p:x:u:Xt: c; do
       tarcmd="x"
       ;;
    i) # [i]ncremental
-      tarargs=${tarargs}g
+      tarargs=${tarargs}ga
+      clientargs="-c 'tarmode inc'"
       ;;
    a) # [a]rchive
       tarargs=${tarargs}a
@@ -97,7 +100,7 @@ while getopts riavl:b:d:N:s:p:x:u:Xt: c; do
    N) # compare with a file, test if [n]ewer
       if [ -f $OPTARG ]; then
        newer=$OPTARG
-        tarargs=${tarargs}N
+       newerarg="N"
       else
        echo >&2 $0: Warning, $OPTARG not found
       fi
@@ -115,7 +118,7 @@ while getopts riavl:b:d:N:s:p:x:u:Xt: c; do
        *)      echo >&2 "$0: Error, block size not numeric: -b $OPTARG"
                exit 1
       esac
-      tarargs=${tarargs}b
+      blocksizearg="b"
       ;;
    p) # specify [p]assword to use
       password="$OPTARG"
@@ -155,7 +158,8 @@ if [ -z "$verbose" ]; then
       echo "blocksize is $blocksize"
 fi
 
+tarargs=${tarargs}${blocksizearg}${newerarg}
+
 eval $SMBCLIENT "'\\\\$server\\$service'" "'$password'" -U "'$username'" \
--E -N $log -D "'$cdcmd'" ${clientargs} \
+-E $log -D "'$cdcmd'" ${clientargs} \
 -T${tarcmd}${tarargs} $blocksize $newer $tapefile '${1+"$@"}' $verbose
-