- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Curious Directory Command Behavior
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 05:57 AM
тАО03-24-2010 05:57 AM
Trying to find *.log files created today before 03:00 with the following command:
$ dir *.log /since /before=03:00:00/date
Returns all the log files within the specified time.
Now I want to get only the last version of the log so I use this command that adds a semicolon after *.log.
$ dir *.log; /since /before=03:00:00/date
I was expecting the last version of all the logs but only get the log that had a single entry.
Is this the expected behavior from this command sequence?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 06:08 AM
тАО03-24-2010 06:08 AM
Re: Curious Directory Command Behavior
That is what you would see if the latest version of the other TESTx.LOGs is dated after 3am. You would need the output of:
dir *.log; /date
to tell that. ; means specifically "the latest version", not "the latest version that matches these other criteria".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 06:22 AM
тАО03-24-2010 06:22 AM
Re: Curious Directory Command Behavior
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 06:41 AM
тАО03-24-2010 06:41 AM
Re: Curious Directory Command Behavior
>>... get the log that had a single entry.
>> Is this the expected behavior from this command sequence?
Yes. That command tell directory to look for the latest version of all the files with type 'LOG' and prune that result set, leaving only those created today, before 03:00.
You'll need to parse directory output, or like Hoff indicates run your own lookup loop and check the articulates with DCL ( F$FILE "RDT" or "CDT" ).
Or perhaps with PERL and the STATS array, or perl functions acting on the stats array ( notably -M or -C ).
btw... I'm sure you know that those version numbers are dangerously close to failing right? (32766 being the max).
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 09:33 AM
тАО03-24-2010 09:33 AM
Re: Curious Directory Command Behavior
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 09:38 AM
тАО03-24-2010 09:38 AM
Re: Curious Directory Command Behavior
1. Find files of that name and the specified version (; means version 0 i.e the highest version)
2. matching the dates
Purely Personal Opinion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 10:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 10:23 AM
тАО03-24-2010 10:23 AM
Re: Curious Directory Command Behavior
>>$ dir *.log /since /before=03:00:00/date /version=1
Thank you. That does give the intended result, but the question is still "why didn't adding the semi-colon to the dir command produce this result."
If I remove the "/before=03:00" from the command it works as expected, it gives me the latest version but it's after 03:00.
Is there a problem with mixing "/since and /before" or "/after for that matter.
For clarification purposes: We had a problem between midnight and 3am this morning and I was looking for what might have caused the problem. Not going to do any processing, just look at logs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 11:02 AM
тАО03-24-2010 11:02 AM
Re: Curious Directory Command Behavior
Thank you. That does give the intended result, but the question is still "why didn't adding the semi-colon to the dir command produce this result."
As I replied before.
Think about it...
How does directory know which files to look at?
It goes into the directory (that's why it is called 'directory and not DFU) to find files to match the basic file name desired.
Then it checks whether attributes (other than FID) were requested and whether any filters were specified. If so, it accesses those potential candidates found and looks to see whether those filters apply
The requested match is for: *.LOG;
That means in OpenVMS speak "the highest version numbered file for each .LOG file.
Using the output you provided that is for some file with a version higher than 24896.
So it accesses that file, and only that version of that files, and finds it does not
fit the date filter.
Regards,
Hein
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2010 12:19 PM
тАО03-24-2010 12:19 PM