Linux Script to check a process is up or not

admin

Administrator
Staff member
I have a server Application which holds 1500 process id, I need a shell Script which checks for every hour whether the process is up, if not start the process using "dsmc -u xxxx -p <em>*</em>*" if it is not started send a mail to my gmail([email protected]). here is the code how can i send a mail to my gmail account.

Code:
   if pidof -s vsftpd = /dev/null; then
      echo 'ftp is stopped'

       sudo /etc/init.d/vsftpd restart
  else 
       echo "The FTP server is Down" | mail -s "Ftp Server is Down" [email protected]
   fi

I don't get mail to my Gmail Account.
Reference: <a href="http://rtcamp.com/wordpress-nginx/tutorials/linux/ubuntu-postfix-gmail-smtp/" rel="nofollow">http://rtcamp.com/wordpress-nginx/tutorials/linux/ubuntu-postfix-gmail-smtp/</a>