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
From looking at man mailx
, the mailx program does not have an option for attaching a file. You could use another program such as mutt.
echo "This is the message body" | mutt -a file.to.attach -s "subject of message" recipient@domain.com
Command line options for mutt can be shown with mutt -h
.
Or, failing mutt:
gzip -c mysqldbbackup.sql | uuencode mysqldbbackup.sql.gz | mail -s "MySQL DB" backup@email.com