Operating System - OpenVMS
1828335 Members
3640 Online
109976 Solutions
New Discussion

list files with minimum versionnumber

 
SOLVED
Go to solution
Sjors Takes
Advisor

list files with minimum versionnumber

Hi all!

Is there a way to list files on a disk with versionnumbers higher than a certain versionnumber? For example:

dir /select=version=min=30000

Only this commando does not exist.

Thanks in advance

Sjors
14 REPLIES 14
Wim Van den Wyngaert
Honored Contributor

Re: list files with minimum versionnumber

Try this. No command available.

Wim
Wim
Duncan Morris
Honored Contributor

Re: list files with minimum versionnumber

If you have DFU available, then your command does exist on a disk basis.

dfu> search ddau: /vers=min:30000

You can also find files with a minimum number of versions

dfu> dir ddau:/vers=25

will list all files on ddau: with at least 25 versions.

DFU is available on the freeware CD collection
Duncan Morris
Honored Contributor
Solution

Re: list files with minimum versionnumber

You can find DFU from here:

http://h71000.www7.hp.com/freeware/freeware70/dfu/

and I have attached a sample of the output from the DFU scan, which is infinitely faster than a straight directory search.

If you are constrained by local policies or old versions of the OS, then use Wim's suggestion
Hein van den Heuvel
Honored Contributor

Re: list files with minimum versionnumber

The command your are looking for will be avaiable in OpenVMS V8.2:

From the DCL book #1...

VERSION=(option[,option]) Displays all files with version numbers that fall within the range specified by one or both of the
following options:
MINIMUM=number
MAXIMUM=number

However, for most applications, notably those walking 'the whole disk', I would still recommend DFU and is walks the INDEXF.SYS in chunks and thus can operate 100x more efficiently. (ok, maybe 10x :-)
Phillip Thayer
Esteemed Contributor

Re: list files with minimum versionnumber

You can use the lexical function

F$SEARCH("disk_name:[*...]*.*;",1) to search for the highest version number in a command procedure. Then it is simply a matter if looking at the result of the f$search and seeing if the version number is higher than a value specified. You could use P1 for the disk name and P2 for the high version number to check for. Loop through this call until you get "" back from the call to indicate that it has checked all files.

Phil

P.S. - That is if you don't have DFU. :)
Once it's in production it's all bugs after that.
Hein van den Heuvel
Honored Contributor

Re: list files with minimum versionnumber


Using a PERL one-liner, the command to do this would be:

$perl -e "while (<[...]*.*;*>) { print if ((split /;/)[1] > 5000) }"



The <[...]*.*;*> is a 'glob' string.
The while (<>) tosses each match into the default variable "$_"
The ";" must be there in the glob string, or it won't be there in the result (to help Unix ports).

The (split /;/) acts on the default variable $_ and delivers an array of chunks split by the seperator, in this case a semicolon.
The ()[1] fetched element 1 in the 0 based array, which here will eb the version numbers.
The print prints the default variable, which is that desired filename.
You may need to ass an explicit newline to that:

print $_ . "\n"
or
print "$_\n"

Because the perl prorgam is a quoted string you'll need to double up on the quotes:

$ perl -e "while (<[...]*.tmp;*>) { print ""$_\n"" if ((split /;/)[1] > 30000) }"


Met vriendelijke groetjes,
Hein.





Tony_289
Advisor

Re: list files with minimum versionnumber

Hello Sjors,

Here's another suggestion, I like
Wim's option though because it lists
out every file above your selected minimum

$!
$! Subtract whatever version number
$! you want from 32767...
$!
$ Number = 2767
$ versions_above = 32767 -'Number'
$!
$ Dir Disk:[000000...]*.*;-'versions_above'
$!

Tony
Hein van den Heuvel
Honored Contributor

Re: list files with minimum versionnumber

Hi Tony,

Did you try that?

The ;-N version numbers are relative.
so ;-2 mean ;5 if there is a ;6 and ;7 but could mean ;1 if there is just ;1;6 and ;`7

Cheers,
Hein.
Tony_289
Advisor

Re: list files with minimum versionnumber

Hein/Sjors
yes, sort of... I won't bore you with the details of what i wanted to (fully) reply with because I seriously mis-clicked when i shouldn't have (See Wim's)... please ignore my reply (Hein, Sjors, and others)-- An HP Forum Faux Pa

Good reponses though

Regards,

Tony
Galen Tackett
Valued Contributor

Re: list files with minimum versionnumber

Sjors,

Others have already suggested using DFU. Here's a refinement that will isolate files to those which backlink to a particular directory, though it isn't elegant or completely foolproof.

Let's say that the directory of interest is USER:[SMITH]. Then do this:

$ DIR/FULL USER:[000000]SMITH.DIR

Note the first number of the File IDfrom the first line of the output. Let's say it's (14085,5,0). Here, 14085 is the number you want.

Then do this:

DFU> SEARCH USER:/VERSION=MIN:50000/BAKFID=14085

What you'll get is a list of all files with a version number of at least 50000 which backlink to the directory of interest.

In some cases I suppose the backlink might not actually point to the directory you want to look at, but otherwise it works pretty well for me. (One such case being a file that's entered in more than one directory via $ SET FILE/ENTER...)

I hope this will help you too.

Galen

Robert_Boyd
Respected Contributor

Re: list files with minimum versionnumber

Here is a command procedure we use on our systems to do the job now.

This command procedure depends on an image or DCL procedure called LOGICAL_FROM_PIPE which you can find the DCL version of on the DCL.OpenVMS.org website.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Sjors Takes
Advisor

Re: list files with minimum versionnumber

ok, thanks for your replies. DFU works fine on our backup system. But I am a little bit worried about a possible system crash. See thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=916010

Does the latest F11X patch solve this problem?

Sjors
Karl Rohwedder
Honored Contributor

Re: list files with minimum versionnumber

Sjors,

the crash I reported was only with the UNDELETE function of DFU, which apparently digs deep into the filesystem.
Read the thread carefully, there was an advice on how to proceed with UNDELETE or just do not use it.

regards Kalle
Sjors Takes
Advisor

Re: list files with minimum versionnumber

dfu works