Skip to content

Instantly share code, notes, and snippets.

@duchenpaul
Last active October 6, 2015 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duchenpaul/8fdc02240c1120d312e2 to your computer and use it in GitHub Desktop.
Save duchenpaul/8fdc02240c1120d312e2 to your computer and use it in GitHub Desktop.
#!/bin/bash
TIMESTAMP=$(date +%F)
sudo cp /var/log/openwrt.log /tmp/openwrt_$TIMESTAMP.log
subject="Openwrt Log on $(date +%F)"
content="Here is the log of openwrt on `date "+%B %d %Y"`: openwrt_$TIMESTAMP.log"
python /home/pi/run/send_mail.py "$subject" "$content" -f /tmp/openwrt_*.log
sudo rm /tmp/openwrt_*.log
logger "The log: openwrt_$TIMESTAMP.log has been sent"
echo "The log of openwrt `date "+%B %d %Y"`: openwrt_$TIMESTAMP.log has been sent"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment