Skip to content

Instantly share code, notes, and snippets.

@joshterrill
Created June 17, 2015 10:35
Show Gist options
  • Save joshterrill/4f4e65bfa6efc49896a7 to your computer and use it in GitHub Desktop.
Save joshterrill/4f4e65bfa6efc49896a7 to your computer and use it in GitHub Desktop.
Bash log mailer
# sendmail -t "joshterrill.dev@gmail.com" < mail.txt
# To: joshterrill.dev@gmail.com
# From: jobs@pig-1-102828
# Subject: Sent from a terminal!
# Thanks for the message!
DATE=`date +%d-%m-%y`
ps aux > /var/www/html/mailerlog/$DATE.txt
sendmail -t "joshterrill.dev@gmail.com" < /var/www/html/mailerlog/$DATE.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment