Daily e-mail for PI drive health to gmail account

Why did I do this; been getting both the Pi-hole-ftl log and the os syslog taking 100% of the the root partition space. I only notice the problem when I get ads on my devices that should not. Go to the console and see issues. To find that the update fails due to the root vol being full.

A couple of items needed: swaks, a crontab entry, a g-mail app pw, and this script.

  1. Installing swanks:
    sudo apt install swaks
  2. Adding a crontab as root (below is what I used) - lots of help with adding the job, mine every day at 1am
    0 1 * * * $HOME/scripts/disk-usage.sh
  3. Create an app pw for your g-mail account. I use g-mail, so that is what my code does other have similar abilities
  4. This script placed under /root/scripts/disk-usage.sh with the execute bit set (chmod -x /root/scripts/disk-usage.sh)

Disk_Usage.txt (2.9 KB)

Please let me know if you have questions of if helped you...