Black ribbon bottom left

Send backup by email with crontab


echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- recipient@domain.com


So probably the approach to follow will be something like,

tar -zcf /home/blah/backup.tgz /home/blah/
echo "Please find attached the backup file" | mutt -a "/home/blah/backup.tgz" -s "File attached" -- recipient@domain.com


I will save the above script as backup_email.sh and schedule the cron job as,

0 1 * * * /path/to/backup_email.sh