Sponsored Content
Top Forums Shell Programming and Scripting Process running time by taking user input Post 302787487 by ahamed101 on Friday 29th of March 2013 05:40:03 PM
Old 03-29-2013
Try this
Code:
ps -eaf -o user,pid,etime,stime,args | awk 'NR>1{n=split($3,t,/:/);if(n==3||t[1]>=30){print}} '

--ahamed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

keeping 10 process running at the same time

Hi guys, I neet to run sqlldr to charge about 50,000 files every day to my DWH, so I need to make an script to keep about 100 processes of sqlldr running at the same time. So, the issue is that i've been trying for a few days to make an script which can keep that amount of processes running, so... (2 Replies)
Discussion started by: razziel
2 Replies

2. Red Hat

login process taking a long time

I'm having a bit of a login performance issue.. wondering if anyone has any ideas where I might look. Here's the scenario... Linux Red Hat ES 4 update 5 regardless of where I login from (ssh or on the text console) after providing the password the system seems to pause for between 30... (4 Replies)
Discussion started by: retlaw
4 Replies

3. Shell Programming and Scripting

Problem while taking input from User

Hi All, I am facing a problem while taking input from user in Shell Script. Basically , I want to read a file line by line. And I want to remove certain lines of that file.But before removing those lines , I need to ask the user whether user wants to remove the lines. If user inputs "Yes" , the... (3 Replies)
Discussion started by: swapnil.nawale
3 Replies

4. UNIX for Dummies Questions & Answers

how to get start time of a running process

I am trying to see if a process is running what was its start time. here is the code that I am using if then echo 'Gateway output processing started.' else VAR=$(ps -ef | grep batch_output_x ) ... fi now the problem i see is when the process is running i get two... (3 Replies)
Discussion started by: akabir77
3 Replies

5. Shell Programming and Scripting

Running a process based on time

Hello All, My script is nearly complete, there is just one last piece that needs to be added in. I need to check for the time, and if it is lets say for example. Sunday at 5:00AM, my script cannot run. I would assume it would be something like this, parden the terrible pseudocode ... (7 Replies)
Discussion started by: jeffs42885
7 Replies

6. Shell Programming and Scripting

Taking one input at a time

Legends, Please help me to come out of the below Bermuda triangle. I have four inputs in a shell script: A B C D Now, If A is passed by user then, B C D will be ignored. If C is passed by user, then A B D will be ignored. Regards, Sandy (11 Replies)
Discussion started by: sdosanjh
11 Replies

7. Shell Programming and Scripting

Help with kill a specific process after certain running time

Hi, Do anybody experience to write a bash script in order to kill a specific process (java) after certain time of running? eg. java java.jar task_run.txt I will run a java program (java.jar) which will run a long list of process (task_run.txt) one by one. I plan to terminate the java... (5 Replies)
Discussion started by: perl_beginner
5 Replies

8. Shell Programming and Scripting

Process running more than require time

Frineds I need assistance in writing a script . Newbie to scripting. How to find list of processes that are running more than an hour . Below i used the step to get the etime and stime . Now by getting the result i need to display longer time process with full listing. ps -aef -o... (10 Replies)
Discussion started by: ajayram_arya
10 Replies

9. Shell Programming and Scripting

Bash Question: HowTo Exit Script with User Input While Process is Running Mid-Loop?

Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies

10. Shell Programming and Scripting

Get how much time process has been running in seconds

I use this command to get the time elapsed for a process ps -eo pid,pcpu,pmem,user,args,etime,cmd --sort=start_time | grep perl It gives in format 19990 0.0 0.0 user /usr/bin/php 5-09:58:51 /usr/bin/php I need in seconds. Please use CODE tags for sample input and output as well... (2 Replies)
Discussion started by: anil510
2 Replies
explain_stime_or_die(3) 				     Library Functions Manual					   explain_stime_or_die(3)

NAME
explain_stime_or_die - set system time and report errors SYNOPSIS
#include <libexplain/stime.h> void explain_stime_or_die(time_t *t); int explain_stime_on_error(time_t *t); DESCRIPTION
The explain_stime_or_die function is used to call the stime(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_stime(3) function, and then the process terminates by calling exit(EXIT_FAILURE). The explain_stime_on_error function is used to call the stime(2) system call. On failure an explanation will be printed to stderr, obtained from the explain_stime(3) function, but still returns to the caller. t The t, exactly as to be passed to the stime(2) system call. RETURN VALUE
The explain_stime_or_die function only returns on success, see stime(2) for more information. On failure, prints an explanation and exits, it does not return. The explain_stime_on_error function always returns the value return by the wrapped stime(2) system call. EXAMPLE
The explain_stime_or_die function is intended to be used in a fashion similar to the following example: explain_stime_or_die(t); SEE ALSO
stime(2) set system time explain_stime(3) explain stime(2) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller explain_stime_or_die(3)
All times are GMT -4. The time now is 08:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy