Page 1 of 1

[bash] Send console output as email

Posted: 19 Feb 2019, 08:37
by rednoah
send-email-log.sh is a universally useful little bash script, that takes an arbitrary command, executes the command, captures the console output, and then sends you a nicely formatted HTML email.

Usage:

Code: Select all

send-email-log filebot -script fn:sysinfo
Install:

Code: Select all

# Fetch script
curl -O https://raw.githubusercontent.com/filebot/plugins/master/bash/send-email-log.sh

# Make script executable
chmod +x send-email-log.sh

# Link script into the path
ln -s $PWD/send-email-log.sh /usr/bin/send-email-log
Configure:

Code: Select all

SMTP_USER="<username>@gmail.com"
SMTP_PASS="<password>"

Image

Re: [bash] Send console output as email

Posted: 27 Feb 2019, 12:20
by rednoah
Well, easy enough to come up with this yourself, but it's a commonly requested feature, so I thought I'll share a model solution.