Hi guys, I'm having some real dramas with the output for a dd command being called from a script. Basically i'm trying to write the whole output from the script to a log file. It all seems to be working fine except the dd command.
So i'm calling the script with:
sh ./script.sh > Logfile.log
Everything gets written to the logfile correctly except the dd commands:
dd bs=2M if=/dev/sda | gzip --fast > /backup/ProntoLVM1_$(date +%d-%m-%Y).bak.gz
The output of this (time, amount of records etc) all still gets printed to the console. I've tried redirecting it with >>, with 2> with 2>&1 etc but it always still gets written to the screen and not the file.
Is there something I'm missing here? Some of those seems to write the actual dd data being copied to the file instead of the output.
Is the correct syntax for the 2>&1 redirect:
command 2>&1 backuplog.log
Thanks in advance guys
EDIT :: Sorry, on RHEL 5.5 server.