Advertisement
RobsonAlexandre

Enviando email com tail -f

Jan 2nd, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.17 KB | None | 0 0
  1. while true
  2. do
  3.     sleep 10
  4.     pid=$!
  5.     Linha=$(tail -Fn1 --pid=$pid /var/log/messages)
  6.     grep "[ACESSO]" <<< "$Linha" && /usr/bin/esmtp usuario@email.com <<< "$Linha"
  7. done &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement