Viewing 1 to 12 of 12 items
Tag Archives: Running

How to check how long a process ran after it finished?

Currently I’m using the following to check how long a process is actually running: ps -eo uid,pid,etime | egrep ‘^ *MY_ID’ | egrep ‘PID_OF_PROCESS’ And that outputs the following: MY_ID PID_OF_PROCESS 00:16 However, after the process ends I want to find out how long it actually ran for but I can’t seem to find that  Full Article…

0

check process

check_process.sh check_process.sh The script checks whether a specific process is running. It just parses output of ps. If the process is not running, the script runs a command to start the process. Features: – check whether a process is running – try to start the process with a specified command – return the result of  Full Article…

0

checkprocess.sh – Check process & restart

I have a process that has been crashing every few days, but needs to be running 24/7 to be effective. Until I find the time to seek out the cause, I need the process to be restarted. This short SH script uses PS to check that the process is running, and if not, runs the  Full Article…

0

How to check if process is running?

To me this script looks fine. Can somebody please assist me in finding what the problem is. Thank you Code: #!/bin/bash #———————————————————————————————————————- #This script allows the user to import a dsx file # # Usage: #./import.sh -s -d -r -f # #———————————————————————————————————————– dbname=”$dbname” dsn=”$dsn” dsxfile=”$dsxfile” rangechk=”$rangechk” verbose=”” reverb=”” module=`basename $0` DSXLOG_MODULE=$module export DSXLOG_MODULE dsxdir=”/var/local/dsx/import” dsximp=”/usr/local/bin/dsximp.exe”  Full Article…

0

Check if program is running with bash shell script?

This is an example of a bash script which checks for some running process (daemon or service) and does specific actions (reload, sends mail) if there is no such process running. check_process(){ # check the args if [ “$1” = “” ]; then return 0 fi #PROCESS_NUM => get the process number regarding the given  Full Article…

0

ps -ef | grep to check if process is running

The script. #! /bin/sh #check the processes and email me if nsexpress is not running if ps -ef | grep “ns-httpd -d /usr/netscape/suitespot/https-lls/config” then echo “nsexpress is running” |mail george.rajapaksa at lls.edu else #echo “nsexpress is not running ” |mail george.rajapaksa at lls.edu cd /usr/netscape/suitespot/https-lls;./start fi The Problem: if pgrep -f “ns-httpd -d /usr/netscape/suitespot/https-lls/config” pgrep  Full Article…

0