Operating System - HP-UX
1833011 Members
2932 Online
110048 Solutions
New Discussion

How to log the output of dd command to a file

 
SOLVED
Go to solution
Aji Thomas
Regular Advisor

How to log the output of dd command to a file

hello

When i run a dd command to do a copy,
For example,
dd if= of= bs=8192
0+1 records in
0+1 records out

It shows the records in and records out.
How can i log this to a backuplog file, just to know the status of my backup

Please can anyone of you can help me out
AJI
3 REPLIES 3
Mel Burslan
Honored Contributor
Solution

Re: How to log the output of dd command to a file

dd if= of= bs=8192 >/tmp/logfile 2>&1

should do
________________________________
UNIX because I majored in cryptology...
Jeff Schussele
Honored Contributor

Re: How to log the output of dd command to a file

Hi,

There are several ways:

1) Use the tee command to direct output to a file

dd if=xxxxx of=xxxxx | tee dd_out.txt

2) Use the script command ahead of dd to capture the whole session

script dd_out.tst;dd if=xxxx of=xxxx

3) Or just redirect standard out
dd if=xxxx of=xxxx > dd_out.txt

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Aji Thomas
Regular Advisor

Re: How to log the output of dd command to a file

Thanks guys for the support,

Mel Burslan it really helped me to resolve my issue.

Regards
AJI