Article 5220V Scripting: managing output in a multi-step operation

Scripting: managing output in a multi-step operation

by
raindogtoo
from LinuxQuestions.org on (#5220V)
I've set up the majority of my scripts to send output (STDOUT & STDERR) to a specific log file using the following format:

script command >> $LOGFILE 2>&1

However that approach isn't working with the following command set:

partclone.ext4 -c -q -s input_device | gzip -c --fast >output_file >> $LOGFILE 2>&1

In this case, the partclone/gzip output ends up being stored in $LOGFILE which obviously is not where it needs to go.

Is there a way to pipe the output to gzip and then into the appropriate destination but still send the console status and error messages to $LOGFILE?latest?d=yIl2AUoC8zA latest?i=z4d2kC95Wm8:vFom9dKQkNA:F7zBnMy latest?i=z4d2kC95Wm8:vFom9dKQkNA:V_sGLiP latest?d=qj6IDK7rITs latest?i=z4d2kC95Wm8:vFom9dKQkNA:gIN9vFwz4d2kC95Wm8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments