While we are on the subject of dates. Another date question


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers While we are on the subject of dates. Another date question
# 8  
Old 09-18-2001
To get into the nitty gritty of the "whys"...
Our job is scheduled via cron in a way, but actually runs based on a trigger file. The cron checks for certain conditions before it launches a session inside an ERP system. The job runs inside an ERP application and can hang at any given point and just not go anywhere, which means that everything appears to be "running" but its really not doing anything. The script itself will not end because it needs the application to end, which its not going to do. (no fix in sight so we have to deal with this)
There is really no way to deal with this except a reasonability check to see if the job has been "running" too long and notify support. There are some points along the process that are outside our control. (too much to go into).
I know this sounds hokey, but its the best we can do for this.
I'll try the different approaches for the time and see if they work for us. The "peak" hours that we are concerned about do not overlap days. That part is easy.
# 9  
Old 09-18-2001
now that you have explained it a bit more. your looking for a realtime action to happen.

If your email funtion is at the base of the script but the script is stuck running in a hung state if you will; your script will never get to the notification funtion.

one line at a time till the end of the file.

A point brought up by my coworker. is.

After the file gets proccessed by your aplication does it dump back to disk? Does it disapear? what happens if an error happens?

You could set up a script that will check for files that have completed in x dir. if you dont see x file send an email. or vise versa.

any thoughts anyone?
# 10  
Old 09-18-2001
Take another look at the script that I posted. It launches the real program in the background, and after 15 minutes, it checks to see if the background job is still running. This will reliably detect any instance of the background job running past the 15 minute deadline.
# 11  
Old 09-18-2001
MySQL

Yes. I caught that the job runs in the background on that script. Good idea - we need to see if we can do that with the application.
There is no output from the session as it is processing data into the ERP system to book sales orders, but that could also be an option.
We don't have consoles, we connect off PC workstations, thus, we mail ourselves the job status to our internet mail id. If its extremely urgent, we send a message to the support pager. During identified critical hours, this is one of the ones that will get sent to the pager.
Thanks for all the ideas.. keep them coming if you have any more.
# 12  
Old 10-24-2003
Hi you,

I think my problem is very similar, so I posted my question here.
I want to measure the time my script runs. So that at the end of teh script I can tell the user the execution of the script demo took 11min 05 sec.

Now I stored the date of the execution and the endtime of the execution.
I just calculated the time like LivinFree in his script.

But the problem is, that if the script starts at 10:59:00 and ends at 11:01:00
I get as result a time of 42 minutes!!!

How can I solve this??

Or is there a better way to measure the time a acript takes within a script. I don't like to have two scripts, with one in the background...

THX

Ben Sky
# 13  
Old 10-24-2003
If you are using ksh you can just use the SECONDS variable. It is the number of seconds that ksh has been running.
# 14  
Old 10-24-2003
THX I did not know, that this variable exists, but I found it in the man page of ksh!! My fault....

And is there an easy way to convert than the seconds into minutes and secondes or just the way of calculating by dividing with 60?!

THX
Ben Sky

Last edited by bensky; 10-24-2003 at 10:14 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Splitting week start date and end date based on custom period start dates

Below are my custom period start and end dates based on a calender, these dates are placed in a file, for each period i need to split into three weeks for each period row, example is given below. Could you please help out to achieve solution through shell script.. File content: ... (2 Replies)
Discussion started by: nani2019
2 Replies

2. UNIX for Advanced & Expert Users

Date between 2 dates

Hi All, Can you help me in finding the business dates (Mon-Fri) between two date ranges.. (forget abt holidays in weekdays) searched and tried a lot but cant figure this. ISs there any special function availble in unix for this (5 Replies)
Discussion started by: Deena1984
5 Replies

3. Shell Programming and Scripting

ksh compare dates INSIDE a file (ie date A is > date B)

In KSH, I am pasting 2 almost identical files together and each one has a date and time on each line. I need to determine if the first instance of the date/time is greater than the 2nd instance of the date/time. If the first instance is greater, I just need to echo that line. I thought I would... (4 Replies)
Discussion started by: right_coaster
4 Replies

4. Shell Programming and Scripting

Need to capture dates between start date and end date Using perl.

Hi All, Want to get all dates and Julian week number for that date between the start date and end date. How can I achive this using perl? (To achive above functionality, I was connecting to the database from DB server. Need to execute the same script in application server, since databse... (6 Replies)
Discussion started by: Nagaraja Akkiva
6 Replies

5. Shell Programming and Scripting

Need to capture all dates between start date and End date.

Hi All, I enter Start date and end date as parameters. I need to capture dates between start date and end date. Please let me know if you have any idea the same. Thanks in advance. Nagaraja Akkivalli. (5 Replies)
Discussion started by: Nagaraja Akkiva
5 Replies

6. Shell Programming and Scripting

Using 'date' to list a range of dates

Hi guys, I have been trying to create a list of dates from a certain range, ie. range from 01011950 to 31122000 But when my below code reaches certain dates, it comes up with a; 'date: invalid date 'yyyy-mm-dd -d 1day' Sofar I have come up with the following, slow and ugly; ... (4 Replies)
Discussion started by: TAPE
4 Replies

7. Solaris

Date after 5 dates in YYYYMMDD format

Hi Experts, How to get date 5 days after current date in YYYYMMDD format? How do we compare date in YYYYMMDD format? Thanks (1 Reply)
Discussion started by: needyourhelp10
1 Replies

8. Shell Programming and Scripting

Generate quarter dates with begin date and end date

Hi All, I am trying to generate quarter dates with user giving input as begin date and end date. Example: Input by user: begin_date = "2009-01-01" end_date = 2010-04-30" required output: 2009-01-01 2009-03-31 09Q01 2009-04-01 2009-06-30 09Q02 . . till 2010-01-01 2010-03-31 10Q01 ... (9 Replies)
Discussion started by: sol_nov
9 Replies

9. Shell Programming and Scripting

Display the last five dates from the given date

Hi all, In Oracle we have got sysdate -1 to find the previous date. Is there any similar way to display date in unix shell scripting? Kindly help me to display the last five dates from the given date Thanks, Geetha (11 Replies)
Discussion started by: iamgeethuj
11 Replies

10. UNIX for Dummies Questions & Answers

using 'date' to get previous days' dates

I am familiar with using the 'date' command to get the current date but I have a situation where I need to get the previous day's date as well as the date two days prior. Theoretically I could use 'expr' to compute these values but I need it to work in instances where the previous month's dates... (2 Replies)
Discussion started by: slant-40
2 Replies
Login or Register to Ask a Question