PDA

View Full Version : How not to report STDOUT of an bash script in /etc/cron.daily ?



Fli
04-28-2017, 08:49 AM
Hello,

one bash script located in /etc/cron.daily is generating STDOUT output. How can i mute STDOUT of this particular bash script and send e-mail with STDERR only if is present?

I know how to redirect output of some lines to /dev/null, but how to do this for whole bash script, only particular script, not all sacripts in /etc/cron.daily ?

----
I found an advice to add bash script code between brackets like this:

{
bash script content
bash script content
bash script content
bash script content
} 1>/dev/null