We have an rsync script for making a backup from server 1 to server 2. The server is Centos-type, Amazon Linux AMI. The script is executed daily via crontab. The backup is made, so cron runs and the script works. A log is created and should be sent to us via mail. This doesn't happen for some reason. If I run the script manually, the mail is sent, so the mailserver (Postfix) works, and the mail script at the end of the rsync script works as well. Below you see the rsync script:
echo "To: firstname.lastname@example.org" > /tmp/rsync_test.log echo "From: email@example.com" >> /tmp/rsync_test.log echo "Subject: Testmail >> /tmp/rsync_test.log echo "" >> /tmp/rsync_test.log cat /tmp/rsync_test.log | sendmail -t
Why doesn't this work and how can I fix it?