Monday, February 5, 2018

dump cron script output from stdin into remote syslog & mail

 dump cron script output from stdin into remote syslog & mail  
   
 because i feel important the more mail i delete (but really need to archive it on a syslog server because, well, you know).  
   
 0 12 * * * root script.sh | cat | tee >(/usr/bin/logger -p local6.notice -t script_tag ) >(mail -s "script output" me@here) 2>&1  
   
 rsyslog configuration directive:  
 local6.*;*.*    @6.6.6.6:514  
   
 (note: @@ is tcp listener)  

No comments: