Falls es jemanden interessiert, ich habe eine Lösung mit curl gefunden:
Bash
#!/bin/bash
cd /backups/
cat head.txt > message.txt
du -sh /backups/ >> message.txt
find /backups/ >> message.txt
cat tail.txt >> message.txt
curl --url 'smtps://smtp.mailbox.org:465/' --ssl-reqd --mail-from 'mail@domain.tld' --mail-rcpt 'mail@domain.tld' --upload-file message.txt --user 'mail@domain.tld:<password>'
Den SMTP Host müsst ihr natürlich ggf. anpassen
head.txt und tail.txt ergeben am Ende mit den Ausgaben von du und find folgende message.txt:
Code
From: "mail@domain.tld" <mail@domain.tld>
To: "mail@domain.tld" <mail@domain.tld>
Subject: This is a report
Hi,
this is the first report, send via curl.
You have following stats:
24,0K /backups/
/backups/
/backups/send_statistics.sh
/backups/message.txt
/backups/tail.txt
/backups/test.php
/backups/head.txt
/backups/testnachricht.txt
Have a nice Day
Display More