Results 1 to 2 of 2
Hi, I am trying to setup email alerts for a script that runs and stores the backup files of our HANA database onto a shared location. Below is the simple ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 4 Weeks Ago #1
- Join Date
- Jul 2014
Email Alerts for Shell Scripts
I am trying to setup email alerts for a script that runs and stores the backup files of our HANA database onto a shared location. Below is the simple script i wrote and it is moves the files from the default storage location to network storage everyday.
mkdir /mnt/hana/`date +%y%m%d`
if mv /usr/sap/TNP/HDB01/backup/data_test/* /mnt/hana/`date +%y%m%d` #
then echo "Copy successful " # >> $log_file
else echo "Copy failed " # >> $log_file
Could someone tell me how can i setup email alerts for this? The outputs Copy Succesful and Copy failed shows up in PUTTY as of now.
Will there be any server (smtp) settings on the server that need be configured? I would appreciate if someone can guide me how to implement this.
- 4 Weeks Ago #2
- Join Date
- Dec 2013
Without knowing anything about your setup I'd say you do need to setup sendmail to relay. If that is setup then it is simple to use the program mail from a bash script. Since you're posting to the SuSE forum you can start here for a relay: Linux Email Support Tips Sendmail
Here's a sample bash script: Send mail bash script