Guest User

Untitled

a guest
Jul 24th, 2019
144
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. SUBJECT="Results: Run File"
  13.  
  14. #Change to the jaavprog.jar location
  15. cd ${CLASSPATH}
  16.  
  17. #Run the jar file
  18. ${JAVA} -jar ${CLASSPATH}/javaprog.jar
  19.  
  20. #Send an email to the SysAdmin with the output of the javaprogrun.log
  21. echo -e "Subject: ${SUBJECT}" |
  22. cat - javaprogrun.log |
  23. /usr/sbin/sendmail -f "${FROM}" -t "${ADMINS}"
  24.  
  25. #Copy the log run file into new file format and move to the logs directory
  26. mv javaprogrun.log ${LOGPATH}/xxx-javaprogrun-b2.${LOGDTTM}.log
Advertisement
Add Comment
Please, Sign In to add comment