06-06-2011
Hi Kumaran,
Looks like there is some problem with strftime
vi time.awk
"time.awk" 15 lines, 449 characters
{
split($2,sdate,"/")
split($3,stime,":")
split($4,edate,"/")
split($5,etime,":")
s_secs=mktime(sdate[3]" "sdate[2]" "sdate[1]" "stime[1]" "stime[2]" "stime[3])
e_secs=mktime(edate[3]" "edate[2]" "edate[1]" "etime[1]" "etime[2]" "etime[3])
#print $0
#printf ("%s", strftime("%H:%M:%S", e_secs - s_secs, 1))
print e_secs
print s_secs
print e_secs-s_secs
#printf "%s\n", strftime("%H:%M:%S", e_secs - s_secs, 1)
print $1,strftime("%T",e_secs-s_secs)
}
awk: syntax error near line 14
awk: illegal statement near line 14
:/var/tmp/gautam]$ uname
SunOS
If i remove the line containing strftime it works fine
:/var/tmp/gautam]$ autorep -j jobname -w |grep jobname |awk '{ print $1 "\t\t\t\t\t\t " $2 " " $3 " " $4 " " $5 " " $6 }'|awk -f time.awk
2011 06 06 10 30 26
2011 06 06 10 30 25
0
:/var/tmp/gautam]$
---------- Post updated at 03:37 AM ---------- Previous update was at 03:27 AM ----------
Hi Kumaran,
Looks like there is some problem with strftime
vi time.awk
"time.awk" 15 lines, 449 characters
{
split($2,sdate,"/")
split($3,stime,":")
split($4,edate,"/")
split($5,etime,":")
s_secs=mktime(sdate[3]" "sdate[2]" "sdate[1]" "stime[1]" "stime[2]" "stime[3])
e_secs=mktime(edate[3]" "edate[2]" "edate[1]" "etime[1]" "etime[2]" "etime[3])
#print $0
#printf ("%s", strftime("%H:%M:%S", e_secs - s_secs, 1))
print e_secs
print s_secs
print e_secs-s_secs
#printf "%s\n", strftime("%H:%M:%S", e_secs - s_secs, 1)
print $1,strftime("%T",e_secs-s_secs)
}
awk: syntax error near line 14
awk: illegal statement near line 14
:/var/tmp/gautam]$ uname
SunOS
If i remove the line containing strftime it works fine
:/var/tmp/gautam]$ autorep -j jobname -w |grep jobname |awk '{ print $1 "\t\t\t\t\t\t " $2 " " $3 " " $4 " " $5 " " $6 }'|awk -f time.awk
2011 06 06 10 30 26
2011 06 06 10 30 25
0
:/var/tmp/gautam]$
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
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
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
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
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
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
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
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
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
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
atrm(1) User Commands atrm(1)
NAME
atrm - remove jobs spooled by at or batch
SYNOPSIS
atrm [-afi] [ [ job #] [user...]]
DESCRIPTION
The atrm utility removes delayed-execution jobs that were created with the at(1) command, but have not yet executed. The list of these jobs
and associated job numbers can be displayed by using atq(1).
atrm removes each job-number you specify, and/or all jobs belonging to the user you specify, provided that you own the indicated jobs.
You can only remove jobs belonging to other users if you have solaris.jobs.admin privileges.
OPTIONS
The following options are supported:
-a All. Removes all unexecuted jobs that were created by the current user. If invoked by the privileged user, the entire queue will
be flushed.
-f Force. All information regarding the removal of the specified jobs is suppressed.
-i Interactive. atrm asks if a job should be removed. If you respond with a y, the job will be removed.
FILES
/var/spool/cron/atjobs spool area for at jobs
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
at(1), atq(1), auths(1), cron(1M), auth_attr(4), attributes(5)
SunOS 5.10 13 Aug 1999 atrm(1)