[PLUG] Suppressing shell script output to screen

Paul Heinlein heinlein at madboa.com
Tue Sep 19 22:14:54 UTC 2017


On Tue, 19 Sep 2017, Rich Shepard wrote:

> I have written a short bash script to have root run sa-learn on my 
> spam-uncaught file once each week. When sa-learn runs it posts a 
> message to the console on the number of messages read and the number 
> of messages added to the database.
>
> Where does this message appear if the script is run from 
> cron.weekly? The sa-learn man page does not offer an option for 
> 'quiet' output so I don't know if that result message can be 
> suppressed.

Typically, cron output ends up in your system log (where, exactly, 
depends on your setup) unless you've asked cron to e-mail you the 
output by setting the MAILTO variable.

If you don't want sa-learn to emit anything, ever, then just tell it 
so:

sa-learn --spam /path/to/folder >/dev/null 2>&1

-- 
Paul Heinlein
heinlein at madboa.com
45°38' N, 122°6' W


More information about the PLUG mailing list