Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #Declare the required paths
- JAVA=/usr/local/...../jdk/jre/bin/java
- CLASSPATH=/usr/local/..../apps/EntSurveys
- #Declare the logging params
- LOGPATH = /usr/local/..../logs
- LOGDTTM = $(date "+%Y.%m.%d")
- #Declare the email params
- ADMINS=admin1@company.co.uk,admin2k@company.co.uk
- SUBJECT="Results: Run File"
- FROM=donotreply@company.co.uk
- #Change to the jaavprog.jar location
- cd ${CLASSPATH}
- #Run the jar file
- ${JAVA} -jar ${CLASSPATH}/javaprog.jar
- #Send an email to the SysAdmin with the output of the javaprogrun.log
- echo -e "Subject: ${SUBJECT}" |
- cat - javaprogrun.log |
- /usr/sbin/sendmail -f "${FROM}" -t "${ADMINS}"
- #Copy the log run file into new file format and move to the logs directory
- mv javaprogrun.log ${LOGPATH}/xxx-javaprogrun-b2.${LOGDTTM}.log
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement