SHARE
TWEET

Untitled

a guest Jul 24th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. #Declare the required paths
  4. JAVA=/usr/local/...../jdk/jre/bin/java
  5. CLASSPATH=/usr/local/..../apps/EntSurveys
  6.  
  7. #Declare the logging params
  8. LOGPATH = /usr/local/..../logs
  9. LOGDTTM = $(date "+%Y.%m.%d")
  10.  
  11. #Declare the email params
  12. ADMINS=admin1@company.co.uk,admin2k@company.co.uk
  13. SUBJECT="Results: Run File"
  14. FROM=donotreply@company.co.uk
  15.  
  16. #Change to the jaavprog.jar location
  17. cd ${CLASSPATH}
  18.  
  19. #Run the jar file
  20. ${JAVA} -jar ${CLASSPATH}/javaprog.jar
  21.  
  22. #Send an email to the SysAdmin with the output of the javaprogrun.log
  23. echo -e "Subject: ${SUBJECT}" |
  24. cat - javaprogrun.log |
  25. /usr/sbin/sendmail  -f "${FROM}"  -t "${ADMINS}"
  26.  
  27. #Copy the log run file into new file format and move to the logs directory
  28. mv javaprogrun.log  ${LOGPATH}/xxx-javaprogrun-b2.${LOGDTTM}.log
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top