I\'ve created a script that runs every night on my Linux server that uses mysqldump
to back up each of my MySQL databases to .sql files and packages them togeth
You can use mutt to send the email with attachment
mutt -s "Backup" -a mysqldbbackup.sql backup@email.com < message.txt
Mailutils makes this a piece of cake
echo "Body" | mail.mailutils -M -s "My Subject" -A attachment.pdf mail@example.org
-A file
attaches a file-M
enables MIME, so that you can have an attachment and plaintext body.If not yet installed, run
sudo apt install mailutils
None of the mutt ones worked for me. It was thinking the email address was part of the attachemnt. Had to do:
echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- recipient@domain.com
I used
echo "Start of Body" && uuencode log.cfg readme.txt | mail -s "subject" "a@b.c"
and this worked well for me....
Just to add my 2 cents, I'd write my own PHP Script:
http://php.net/manual/en/function.mail.php
There are lots of ways to do the attachment in the examples on that page.
Not a method for sending email, but you can use an online Git server (e.g. Bitbucket or a similar service) for that.
This way, you can use git push
commands, and all versions will be stored in a compressed and organized way.