I have a .sh script on a red hat machine:
{
statement 1
statement 2
statement 3
etc....
} 2>&1 | tee "logdir/logfile.log"
which logs both to the console and into logfile logfile.com. However, statement 2 is giving a lot of output and I wish to exclude that from the logfile, while still showing output in the console.
Is there a way to exclude a specific statement from the tee to the logfile?
EDIT: A bit of clarification on the statements:
{
echo some information on the environment
echo some checks
rsync -rtpgov /some/folder/ some/other/folder
tar -xf some/other/tar/file.tar -C some/other/folder2
tar -xf some/other/tar/file.tar -C some/other/folder3
tar -xf some/other/tar/file.tar -C some/other/folder4
etc...
echo some finishing checks
} 2>&1 | tee "logdir/logfile.log"
I wish to exclude the rsync from writing to the logfile.log while still seeing the output in the console.