Sponsored Content
Full Discussion: Job Runtimes by AWK
Top Forums Shell Programming and Scripting Job Runtimes by AWK Post 302527914 by cgk1983 on Monday 6th of June 2011 03:36:37 AM
Old 06-06-2011
Job Runtimes by AWK

Hi ,

I need to find runtime of jobs.

I have written below script to get start and end times for a list of jobs.

Code:
#!/bin/bash
 
InputFile_Name=/var/tmp/cgk/pre2_oper_status_7amcheck_jobs
if [ ! -f $InputFile_Name  ]
then
  echo "File: $InputFile_Name  doesn't exist , Pls check & run again"
  echo "Exiting the script"
  exit 1;
fi
while read Job_Name
do
  if [ ! -z $Job_Name ]
  then
        len=`echo $Job_Name | awk  '{print length }'`
          if [ $len -ge 24 ]
          then
                autorep -j $Job_Name  -w | grep -i $Job_Name |  awk '{ print $1 "\t\t\t\t   " $2 " " $3 " " $4 " " $5 " " $6 }'
          else
                autorep -j $Job_Name  -w | grep -i $Job_Name |  awk '{ print $1 "\t\t\t\t\t\t " $2 " " $3 " " $4 " " $5 " " $6 }'
          fi
  else
     echo ""
  fi
done  < $InputFile_Name
echo ""
exit 0

Output :--

Code:
jobname1        04/06/2011 09:33:37 04/06/2011 09:34:04 SU
jobname2        04/06/2011 09:51:33 04/06/2011 10:02:28 SU
jobname3        04/06/2011 09:51:37 04/06/2011 10:08:56 SU


I am trying to use script in below link

https://www.unix.com/shell-programmin...g-entries.html

But i am not able to get the run times of each job in HH:MIN:SEC

Can some one assist on this to get run times of each job.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

killing unix job after the job process completes

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. ... (1 Reply)
Discussion started by: dtazv
1 Replies

2. Solaris

killing a unix job after the job process gets completed

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies

3. Shell Programming and Scripting

Job dependent on other job

Hi All I am trying to run one command ie grep but I want it should execute only after the completion of a shell script has finished. eg Following is my script : java -mx64m $JAVA_OPTS -Dant.home=$ANT_HOME -classpath $_CLASSPATH org.apache.tools.ant.Main -verbose -buildfile /opt/bea/wls... (4 Replies)
Discussion started by: pankajkrmishra
4 Replies

4. UNIX for Dummies Questions & Answers

How to insert child job under a box job?

I have this box job and it contains only one job under it which is to load a file. I want to insert a "File Watcher", "Copy File" to it? Have no clue how to do that...any help plzzz... (4 Replies)
Discussion started by: xejatt
4 Replies

5. Shell Programming and Scripting

Need logic for check automated Job work in awk or SED.

I have a Java program which will automatically trigger some scheduled job to update Db or some other work. I am tracking the jobs with log messages and finding out it is properly run or not. I want to write a script to capture it correctly on time. Say Job1 is running on 15, 30, and 45 every... (5 Replies)
Discussion started by: senthilkumar_ak
5 Replies

6. Shell Programming and Scripting

PL SQL Runtimes different in Shell script log

Hi, This run times recorded in UX shell script appears peculiar to me. The PL / SQL stored procedure is called through sqlplus from UNIX shell script and then a log is created with run times recorded. The first set has actually taken 6 Hrs but the recorded time indicates it is only 2 Hrs and... (1 Reply)
Discussion started by: Nanu_Manju
1 Replies

7. Advertise with Us

Looking for job

Hi, i just got laid off :D, not fun, but i have a very wierd feeling. I want to continue my cloud computing exciting work and I am looking for takers. A brief of my skills is 10 years exp in dev client server apps on unix platform using java/c++. 3 years of ruby. last one year of amazon ec2 and... (1 Reply)
Discussion started by: linuxpenguin
1 Replies

8. Shell Programming and Scripting

Script to Start a Job after finding the Old job completed

Hi Experts, I need a script advice to schedule 12 jobs ( SAS Codes execute back ground ). Algorithem: 1. Script checks first job. 2. Finds first job is done; invoke second job. 3. finds second job is done; invoke third job. .. Request you to please assist. (3 Replies)
Discussion started by: Jerald Nathan
3 Replies

9. Shell Programming and Scripting

autosys job configuration for job failure.

We need to configure autosys that when a job fails continously for 3 times, we need to call another job. Is this possible in Autosys, or can anyone advice on the alternative. (2 Replies)
Discussion started by: sangea
2 Replies

10. UNIX for Advanced & Expert Users

Autosys Job: Job did not start

I have submitted an autosys job and force start it. Autosys hit the job 4 times to restart but it did not start and finally I terminate the job. Any idea why the job did not start. Below is the code I executed. 1214 missun0ap /export/home/bzn97r/develop/dswi/jil$ sendevent -E FORCE_STARTJOB... (0 Replies)
Discussion started by: jnrohit2k
0 Replies
queuedefs(4)                                                       File Formats                                                       queuedefs(4)

NAME
queuedefs - queue description file for at, batch, and cron SYNOPSIS
/etc/cron.d/queuedefs DESCRIPTION
The queuedefs file describes the characteristics of the queues managed by cron(1M). Each non-comment line in this file describes one queue. The format of the lines are as follows: q.[njobj][nicen][nwaitw] The fields in this line are: q The name of the queue. a is the default queue for jobs started by at(1); b is the default queue for jobs started by batch (see at(1)); c is the default queue for jobs run from a crontab(1) file. njob The maximum number of jobs that can be run simultaneously in that queue; if more than njob jobs are ready to run, only the first njob jobs will be run, and the others will be run as jobs that are currently running terminate. The default value is 100. nice The nice(1) value to give to all jobs in that queue that are not run with a user ID of super-user. The default value is 2. nwait The number of seconds to wait before rescheduling a job that was deferred because more than njob jobs were running in that job's queue, or because the system-wide limit of jobs executing has been reached. The default value is 60. Lines beginning with # are comments, and are ignored. EXAMPLES
Example 1: A sample file. # # a.4j1n b.2j2n90w This file specifies that the a queue, for at jobs, can have up to 4 jobs running simultaneously; those jobs will be run with a nice value of 1. As no nwait value was given, if a job cannot be run because too many other jobs are running cron will wait 60 seconds before trying again to run it. The b queue, for batch(1) jobs, can have up to 2 jobs running simultaneously; those jobs will be run with a nice(1) value of 2. If a job cannot be run because too many other jobs are running, cron(1M) will wait 90 seconds before trying again to run it. All other queues can have up to 100 jobs running simultaneously; they will be run with a nice value of 2, and if a job cannot be run because too many other jobs are running cron will wait 60 seconds before trying again to run it. FILES
/etc/cron.d/queuedefs queue description file for at, batch, and cron. SEE ALSO
at(1), crontab(1), nice(1), cron(1M) SunOS 5.10 1 Mar 1994 queuedefs(4)
All times are GMT -4. The time now is 09:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy