Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stdout from ufsdump|gzip command 1

Status
Not open for further replies.

ngrimes

Technical User
Dec 14, 2006
2
IE
How can I redirect stdout from the ufsdump of a ufsdump|gzip command line?
e.g. starting with the following, how can I send the ufsdump stdout (and stderr) info to a logfile:
$ ufsdump 0uf - /home | gzip > /tmp/home.gz

I've tried:

$ ufsdump 0uf - /home | gzip > /tmp/home.gz >> /tmp/ufsdump.out 2>&1

and
$ ufsdump 0uf - /home >> /tmp/ufsdump.out 2>&1 | gzip > /tmp/home.gz

but either way, the dump itself gets written to the logfile.
 
By using the "f -" options you are forcing it to send the dump to stdout, so you will only ever be able to redirect stderr separately.

Fortunately all of the output that ufsdump produces that is not part of the dump goes to stderr, so you should only need to redirect that anyway.

So I think this should do what you want:

[tt]$ ufsdump 0uf - /home 2> /tmp/ufsdump.out | gzip > /tmp/home.gz[/tt]

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top