This is not going to work the way you want it to. A file (obviously with a filename) needs to be stored in the tar. That bit (the filename) is obviously missing if you just pipe the contents of the download to tar
. I don't see any way to tell tar
that it should pack stdin
and specify a filename for that.
That said, I really do not see a way to achieve that with standard unix commands. Obviously, you might be able to write something yourself instead, for example using python
and the request
and tarfile
modules which should not be to difficult if you are a bit handy with coding.
Until then, or if you have to rely on the available unix commands, you will need to stick to downloading to a temporary file, taring, then deleting the file. To not need to specify the filename multiple times, I would suggest using a variable:
DOWNLOAD=<FILENAME>; wget <DOMAIN>/$DOWNLOAD && tar -cvf $DOWNLOAD.tar --remove-files $DOWNLOAD
wget -S --header="accept-encoding: gzip" url
and obtain the gziped file; For a single file, file.gzip is a more natural solution than file.tgz.xxx.tar.gz
instead ofxxx.gz
if you only have one file.