Hi,

I thought I could create a tar archive on the local computer, and pipe it via ssh to append to a remote archive. This did not work. It seems that with GNU tar 1.34, appending to a tar archive from /dev/stdin or similar non-seekable input like bash process substitution does not work.

Here is an example. First, create some trivial archives:

$ echo Hello\ World > foo
$ tar cf foo.tar foo
$ cp foo.tar bar.tar

Now, let's try appending from /dev/stdin:

$ md5sum foo.tar
052b2b73a89f5ea4f587adc82a2ba87e  foo.tar
$ cat bar.tar | tar -Af foo.tar /dev/stdin
$ tar tvvf foo.tar
-rw-r--r-- pi/pi            12 2022-11-02 23:56 foo
$ md5sum foo.tar
052b2b73a89f5ea4f587adc82a2ba87e  foo.tar

That didn't change the archive at all, but there was no error message saying that something went wrong. I think that's a bug. Now do a proper append, to show how it should work:

$ tar Af foo.tar bar.tar
$ tar tvvf foo.tar
-rw-r--r-- pi/pi            12 2022-11-02 23:56 foo
-rw-r--r-- pi/pi            12 2022-11-02 23:56 foo

This was the expected result.

Thanks,
Boris

Reply via email to