Derive date from a calendar


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Derive date from a calendar
# 1  
Old 04-17-2007
Derive date from a calendar

I'm using AutoSys as scheduler for my application.

I maintain a calendar in AutoSys which specifies when a job should run. A unix shell scripts runs on the days spceified by calendar and processes incoming files.
These incoming files contain dates embedded in the filenames.

My job needs to pick up the files whose date is same as the job run date.(Please note that run date may not be current date on few occasions and hence I cannot go by this method)

So, I want to read the calendar for the date and then look up for the filename containing that date.

Can anyone suggest if this is possible?


Thanks
# 2  
Old 04-17-2007
You wanted the file name which has got the date as that of the current date/job run date.Am i right?

What is the format of the embedded date in the file name? Can we not get the current date and list all files that has the current date in it using find commands name pattern expression?

Thanks
Nagarajan Ganesan.
# 3  
Old 04-17-2007
Yes, In normal scenarios, my job run date is same as current date.
In such cases, I'm looking up for files which have current date in file name.

But, there are certain situations where my job preprocessing takes longer time and eventually current date is different than the job start date (run date).

If I go with current date, I may end up picking up wrong files.

That is the reason I was looking if any common possible appraoch is present.

I understand that I can look for files as soon as the job starts so that current date remains same. But, wanted to know if there is any way to query calendar and get date.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Derive date and its Volume number

Hi All, I have a list of date number (YYYYMMDD) and its own number in a file. Here is the example 20170320 D100001 D100002 D100003 20170321 D200001 D200002 D200004 D200005 20170322 D200005 D200006 D200007 (4 Replies)
Discussion started by: ckwan123
4 Replies

2. Shell Programming and Scripting

Calculate the calendar date since Jan 1, 2000

Does anyone know how to calculate a calendar date since Jan 1, 2000 (this is day 1). I am using CSH with a Solaris system (no GNU products installed). Example: Input from the user (number of days): 4444 Output (dd mmm yy) 02 mar 12 ---------- Post updated at 09:40 PM ----------... (9 Replies)
Discussion started by: thibodc
9 Replies

3. Shell Programming and Scripting

How to derive the last Sunday's date when Current date value is passed

Hi All, I have a requirement in my project where a batch runs on any day of a week. The input files will land to the server every Sunday. I need to read these files based on the current BUS_DAY (which falls any day of the week). For e.g : if the BUS_DAY is 20120308, we need to derive the... (3 Replies)
Discussion started by: dsfreddie
3 Replies

4. Shell Programming and Scripting

Derive the Year value from the date value

Hi All, I have two dates: PREVIOUS_DAY and CURRENT_DAY. I need to test the these two values years are same or not. PREVIOUS_DAY like '%y%m%d' i.e values like 111010, 111011, 111012 etc. For CURRENT_YEAR:'date +%Y' use this command. How can derive the year value from PREVIOUS_DAY and... (1 Reply)
Discussion started by: pdathu
1 Replies

5. Shell Programming and Scripting

Calendar AWK

Hi, how should I use system command cal (calendar) in awk?, I have try several combinations and none works. Here what I have done. awk -f '{print cal}' awk -f '{print 'cal'}' awk -f '{print "cal"}' awk -f {print cal} Regards. (2 Replies)
Discussion started by: Godie
2 Replies

6. Shell Programming and Scripting

Julian date to Calendar date conversion

Hi all, I require to convert julian date to normal calander date in unix for eg julian date=122 now i want corresponding calander date ---------------------------------------- gr8 if give very small command/script and please explain the steps as well(imp) Thanks ... (3 Replies)
Discussion started by: RahulJoshi
3 Replies

7. Shell Programming and Scripting

How to delete lines in a file that have duplicates or derive the lines that aper once

Input: a b b c d d I need: a c I know how to get this (the lines that have duplicates) : b d sort file | uniq -d But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem. (3 Replies)
Discussion started by: necroman08
3 Replies

8. Shell Programming and Scripting

autosys calendar

Hi, Is there any autosys calendar for last day of a month(irrespective of holidays) For eg., Jan 31, Feb 28(29), Mar 31, Apr 30 ... Thanks in Advance (2 Replies)
Discussion started by: rspk_praveen
2 Replies

9. Shell Programming and Scripting

Calendar date to Julian and Back

I need Unix, ksh scripts that will convert dates - Gregorian to Julian and Julian to Gregorian. Input for converting Gregorian to Julian would be in the form of CCYYMMDD with the output being CCYYDDD. Input for converting Julian to Gregorian would be CCYYDDD with the output being CCYYMMDD. ... (4 Replies)
Discussion started by: BCarlson
4 Replies
Login or Register to Ask a Question