Monthly Archives: March 2019

Shell script to detect and start tomcat

Shell Script check if apache tomcat is running or not if stopped, script will detect and start #!/bin/bash #check if apache tomcat is runningif pgrep tomcat >/dev/null 2>&1thenecho “Tomcat is running”else /usr/local/tomcat/bin/startup.shecho “Tomcat is not running”fi

Posted in Shell script, Unix/Linux | Leave a comment

Windows bat script to get day of the week

rem Script to get the day of the week in windows command line rem ie Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday @echo off SETLOCAL SET /a count=0 FOR /F “skip=1” %%D IN (‘wmic path win32_localtime get dayofweek’) DO ( … Continue reading

Posted in Batch script, Windows | Leave a comment