RHEL7: Getting "tar: write error" message when untaring from a pipe executing "ssh" command
Issue
-
When executing a
tarcommand piped from asshcommand, thetarcommand sometimes exits with message tar: write error, as shown in the example below$ (ssh -n remotesystem "cd src && tar cf - ." | (cd dst && tar xpvBf -)) 2>&1 | grep "write error" tar: write error -
The issue mainly happens when using ksh as user shell. It happens rarely with bash but may happen anyway.
Environment
- Red Hat Enterprise Linux 7
- openssh
- tar
- ksh or bash
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.