bug-coreutils
[Top][All Lists]
Advanced

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

bug#32751: split does not break on error from tar


From: Alexander Fieroch
Subject: bug#32751: split does not break on error from tar
Date: Mon, 17 Sep 2018 10:38:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hi all,

I found a bug in "split".
I want to tar some files but some of them have wrong permissions. tar puts out an exit code 2 "Cannot open: Permission denied". That is good because in my script I can catch this error and react to this.

$ tar -c -f /tmp/test.tar -C /media/testpath testfile ; echo $?
tar: testfile: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
2

Unfortunately my tar directory is too big to save it in one file on my filesystem that I have to split the archive but doing this "split" does not get the error code 2 from tar and does not break as it should:

$ tar -c -f - -C /media/testpath testfile | split - ; echo $?
tar: testfile: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
0

In the end I got a tar file without files that have no permissions and my script does not break because of error code 0.

Thanks!

----
Ubuntu 18.04.1
tar 1.29b
coreutils 8.28
----

Best regards,
Alexander

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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