Skip to content

Instantly share code, notes, and snippets.

@mcdruid
Last active August 29, 2015 14:14
Show Gist options
  • Save mcdruid/0e0d444845fed6c4ea46 to your computer and use it in GitHub Desktop.
Save mcdruid/0e0d444845fed6c4ea46 to your computer and use it in GitHub Desktop.
Example report-by-email script suitable for running on cron
#!/bin/bash
# space separate multiple e-mails
mail_recipients='drew.webber@acquia.com drew.webber+test@acquia.com'
mail_subject="Monthly report for $(hostname +s) on $(date +'%F')"
report_commands='df -h /mnt/gfs'
sh -c "$report_commands" | mail -s "$mail_subject" $mail_recipients
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment