How to run a truss command with piped output?
# truss -leDo /tmp/truss.out tar cvf - dirs/ | gzip -1 > archive.tar.gz
I get only the "tar" output in truss, not from gzip!
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Have you tried using
-f ? It tells truss to follow any children the original command spawns. I'm not sure if that will work because the tar command isn't actually spawning the gzip command.
The other option that might work is:
truss -leDo /tmp/truss.tar.out tar cvf - dirs/ | truss -leDo /tmp/truss.gzip.out gzip -1 > archive.tar.gz
Again, however, I don't know if it will work but this time it's because I don't know what truss does to STDIN.
If both of those fail, you might get somewhere by using the
-f option and wrapping both of them in a shell:
truss -leDo /tmp/truss.out ( tar cvf - dirs/ | gzip -1 > archive.tar.gz )
This one requires bash but it could be modified to run under other shells.
All of this is assuming that you want the
gzip command separate. If you don't need that, you could just use the
-z option to tar to have it do the compression.