how to check whether a process started at particular time


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to check whether a process started at particular time
# 1  
Old 09-03-2012
how to check whether a process started at particular time

I want to check whether a particular process has started at 10:00a.m or not.
I can check process by ps -fu but dont know how to check it with respect to time. Could anyone help me with this?

---------- Post updated at 11:14 AM ---------- Previous update was at 10:52 AM ----------

can i use 'at' in this scenario?
# 2  
Old 09-03-2012
From man at:
Quote:
at executes commands at a specified time.
Is if you want to run it at particular time, you'd use at.
If you just need to check when it started, and you don't have much control about how it started or when, then just look at the output of ps. You should see a column START that lists the start times.
# 3  
Old 09-03-2012
at will launch a job at a given time, it cannot be of any help for processes not launched by at...
# 4  
Old 09-03-2012
I want to check all this process in shell script...will 'at' work in shell scripting?
# 5  
Old 09-03-2012
Quote:
Originally Posted by kishore kumar
I want to check all this process in shell script...will 'at' work in shell scripting?
Hi,

What about maintaining logs....?
Just insert date at the start when script kick off...
# 6  
Old 09-03-2012
I want to execute this code at 10:00 AM
Code:
if [ -z $ "k" ]
then
  echo "billing done";
fi


Last edited by Franklin52; 09-03-2012 at 05:45 AM.. Reason: Please use code tags for data and code samples
# 7  
Old 09-03-2012
Use code tags..

Quote:
Originally Posted by kishore kumar
I want to check whether following code executing at 10:00 AM
Code:
 if [ -z $ "k" ]
then
echo "billing done";
date
fi

Just add date to the code....

Are you redirecting your output to any file..?

Check if you can implement this.Smilie

Code:
if [ -z $ "k" ]
then
echo "billing done" >> output.log
date  >> output.log
fi


Last edited by pamu; 09-03-2012 at 03:54 AM.. Reason: changed file name...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check whether shell script has started.

How can i ceck as shellscript, if a other shellscript has been started? The other script can bee started by a other user. The task will not run twice (5 Replies)
Discussion started by: Linuxmann
5 Replies

2. AIX

Check that memory page is filled by zeros when a process gets it in first time

I have to check whether AIX fills physical memory pages by zeros when they are given for a new process (or may be when they are freed from an address space, but it's hardly probable). In other words when a process gets a new memory page, this one must be cleaned. I've solved this issue for... (2 Replies)
Discussion started by: sokolovm
2 Replies

3. AIX

How to check a script was started using 'sudo' ?

How can I from within a script, find out if that script was started using 'sudo' and by a valid soduer ? (1 Reply)
Discussion started by: Browser_ice
1 Replies

4. Shell Programming and Scripting

Process id of the exe started with nohup

Hi, I have a strange problem. In my shell script, i am startting another program (a c++ exe) with nohup . I am getting the process id of this started process with using $! I am writing this process id into another file so that i can keep checking for this process ids to check whether the... (2 Replies)
Discussion started by: parvathi_rd
2 Replies

5. Shell Programming and Scripting

Pls Help me out ... I want to check process status at regular intervals of time

I want to check process status at regular interval of time ... so i ha wirtten this BUT its not working when i placed this peace of code in .sh .. please help me out #!/bin/sh w = ps -ef|grep processname | wc - l echo $w if ; then Banner "Proceesname Problem" else Banner " Running... (5 Replies)
Discussion started by: srinivasvandana
5 Replies

6. UNIX for Advanced & Expert Users

how to know that a perticular process is started!!!

Hi all, I wanted a write a script which will start executing whenever a particular process will starts running in a background. Is there is any way in Unix if a directory contents changed then a signal/Interrupt will generated and by taking status of that interrupt I can execute some scripts.... (11 Replies)
Discussion started by: zing_foru
11 Replies

7. UNIX for Dummies Questions & Answers

Process started on console

Please can someone describe what causes undesired process startup on system console. ps -ef output is like: root 1763 1 0 16:22:24 console 0:00 /bin/sh /usr/System........ process is blocking system console for any access (2 Replies)
Discussion started by: zverzak
2 Replies

8. Programming

Child process is not getting started

Hi, When i m trying to run below code,its entering into wait stage. output: In parent pid=2134 // some random value assigned to child process parent waiting..... and then it keeps on waiting for child to get terminate Y this child is not getting... (5 Replies)
Discussion started by: Crab
5 Replies

9. UNIX for Dummies Questions & Answers

is there any way to know how much time process was running from the moment it started

i have process that was started few days ago , is there way to know by its id how long it was alive in the system ? Thanks (2 Replies)
Discussion started by: umen
2 Replies

10. Shell Programming and Scripting

PID of process started in background??

I am having a problem getting the PID of a process I start in the background is a csh. In tcsh and sh it's simple $! give it to you But in csh this just returns Variable syntax From the man page it should work but it doesn't???? Any help. (2 Replies)
Discussion started by: stilllooking
2 Replies
Login or Register to Ask a Question