Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How do i do a date calculation on Unix?

Re: How do i do a date calculation on Unix?

From: Ban Spam <ban-spam_at_home.com>
Date: Sun, 27 Aug 2000 18:51:42 GMT
Message-ID: <8F9D756D6californiadreamingSD@news>

kheunc_at_yahoo.com (bany1) wrote in <39A8974C.76A9661B_at_yahoo.com>:

>Steve,
>I don't think Unix has a date calculation command. What are you trying to
 do
>with the date calculation? If you want to run something at a specific
 time and
>day then why don't you schedule in cron. Hope this helps
>
>"Steve_at_e-DBA" wrote:
>
>> Hello,
>>
>> I am trying to do a date calculation in Unix. I have a script which
 does a
>> simple grep for today's date in a web log. Ideally it would be good if
 I
>> can get this to run the next day instead of 23:55 for the current day!!
>>
>> I am using :
>>
>> SunOS b06-1-25 5.7 Generic_106541-10 sun4u sparc SUNW,UltraSPARC-IIi-
 cEngine
>>
>> Thanks in advance
>>
>> Steve.
>
>

One "trick" I've used in the past & I'm not sure will help you or not. I have a cron job that runs at 0001 daily. It manipulates two files; "yesterday" & "today". Each of these contains an appropraitely formatted date string that you need to use.

1) rm /YESTERDAY
2) mv /TODAY /YESTERDAY
3) date > /TODAY

Now when a job runs during "today" it can easily obtain the contents of /YESTERDAY to use as needed.

HTH & YMMV! Received on Sun Aug 27 2000 - 13:51:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US