The title is not as easy as it sounds.... I am trying to exclude and file while ssh and untaring the file on the fly.
The command I am using is... The command typically works but recently I've add the X option along with the exclude file. Essentially, the exclude file is being ignored when run on the fly, as below.
tar -cvfX - /usr/local/bin/exclude.txt ${var} | ssh ${system} "(cd /zones/${zone}/root; tar xnf -)"
Running the following works all the time....
tar -cvfX new.tar /usr/local/bin/exclude.txt /export/home
But when adding the ssh along with the exclude file, it fails.
May help if you put the output of uname -a so folks know what OS this is ...
I tried your command on Solaris 10 - changed it to the following and it worked - of course, ${var} and ${system} were actually set versus getting the value from a variable - change " to ' and give it a try:
tar -cvfX - /tmp/notar.info /var/test | ssh mytestsystem '(cd /zones/${zone}/root; tar xnf -)'