Find the answer to your Linux question:
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.
  1. #1
    Just Joined!
    Join Date
    Jul 2014
    Posts
    1

    Email Alerts for Shell Scripts


    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 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
    fi

    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.

    Thanks,

  2. #2
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,377
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •