smbtar: stdout & gzip

Giulio giuliox at
Sun Nov 15 12:53:11 GMT 1998

I need to zip the output of smbtar, but it seems to me that the tar extensions of smbclient don't support any zip option; if I'm wrong please tell me and stop further reading :)

I'm trying to pipe the output of smbclient/smbtar to gzip.
Basically something like:
smbclient  '\server\share' -E -N -Tc - | gzip > test.tar.gz

However I have a problem with smbclient tarring to standard output:

smbclient  '\server\share' -E -N -Tc test.tar
and then
tar tvf test.tar     ---> all is ok

smbclient  '\server\share' -E -N -Tc - > test.tar
and then
tar tvf test.tar  -----> shows something like:
:tar: Skipping to next file header            <<<--------- problem

I can untar this file ok with tar on the samba server, but smbclient fails to untar this file to a share, because it stops just when it reaches that point saying:
checksums don't match 0 27745
abandoning restore, -1 from readtarheader

So that I can't pass the output of smbclient to gzip because it is not perfectly ok.

I tried with different "servers" (win95 and win98) and different shares.

What's the reason?

Another question (I don't know much about stdin and stout redirection....):

With tar I can use the -z option to tar&zip, however,  I can even do:

tar cvf - mydir| gzip > test.tar.gz

and see all the files that are being tarred and gzipped.

smbclient '\\server\share' -N -E -Tc - |gzip > test.tar.gz

doesn't show the files scrolling on the screen, why?

(With decompression:
gzip -dc test.tar.gz|smbclient '\\server\share' -N -E -Tc -
the file are shown on the screen instead).


More information about the samba mailing list