Advertisement
Guest User

Untitled

a guest
Jul 24th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement