Operating System - OpenVMS

Re: Stop Version Numbers on a file

 
Shelby Donald
New Member

Re: Stop Version Numbers on a file

Thanks,
I have the Version_Limit=1.
Guess I'll have a batch job, as you have suggested, to go rename the file.

$ RENAME filename.ext;* TEMPORARY.TMP;
$ RENAME TEMPORARY.TMP;* filename.ext;

The problem occurs because the jobs run continuously and a new file is sent every 15 seconds. There is normally no user intervention. It gets to 32767 and the data appears to stop updating. I had not thought of a batch job to check the version number and reset it when necessary, or just reset it at midnight each day.
Robert Gezelter
Honored Contributor

Re: Stop Version Numbers on a file

Shelby,

Okay, the last post clarified some issues. It is not the version number that is actually the problem, it is the maxing out of the version numbers when a new file is created every 15 seconds (15 second interval == 4 files/minute, 240 files/hour, 5,760 files/day, ... -- in essence, the file version hits the ceiling in a little less than one week).

Care need be exercised when resetting the version numbers when files are being actively created. It is easy to have a collision and switch the latest and next to latest files.

If the process generating the files is running free, I would recommend caution, and a threshold some point before the 32K limit.

- Bob Gezelter, http://www.rlgsc.com
Jess Goodman
Esteemed Contributor

Re: Stop Version Numbers on a file

Since you have only one version of the file all you have to do (in a daily batch job for example):

$ RENAME filename.exe ;1

Note that this will reset the version limit of the file to the directory's default version limit. So if that is not also 1 you must reset the file version limit back to 1 after the above.

When multiple versions of a file have to be RENAMEd to lower the high version numbers I use a command file which has a loop of F$SEARCH and RENAMEes. I can post this if asked.

The suggested temporary file RENAMEs method is ok if used interactively (when you can check it with DIRECTORY commands), but it NOT safe to use in a daily batch job or another automated fix.

Consider what would happend if a new filename.ext was created while either of these two RENAMEs are executing, or in between them.

$ RENAME filename.ext;* TEMPORARY.TMP;
$ RENAME TEMPORARY.TMP;* filename.ext;

The newest file would not end up with the highest version number!
I have one, but it's personal.
Hoff
Honored Contributor

Re: Stop Version Numbers on a file

The whole scheme here seems somewhat unstable at best, resource intensive, and rather prone to various failures including lock collisions and failed processes, and also exposed to lost or duplicate data.

This is not the solution I'd usually pick, not a 15 second file-polling ftp-based file transfer. From experience architecting these and resolving these over the years, this case looks to be an old and seemingly stable and simple solution that was speeded up to meet newer responsiveness requirements. And a solution that has become somewhat unstable, and somewhat problematic as the transfer latency has been lowered and/or as the bandwidth has increased.

But if the customer here is operating with knowledge of the limits of the current data transfer design, well, okfine...
Shelby Donald
New Member

Re: Stop Version Numbers on a file

The choice of data transfer methods was not up to us. We are interfacing with a vendor supplied piece of software.
Willem Grooters
Honored Contributor

Re: Stop Version Numbers on a file

SENDING files only? Let me suggest another approach.
Does it HAVE to be on port 21 (default) of could you use another port to do this?
If so, this is what you could do:

* Copy the command procedure that is usually on port 21 (TCPIP$system:TCPIP$FTP_RUN) to another location and name.
* When done, do a PURGE of all files and rename the remaining failes to version 1.
* Create a new service on any port you like - similar to the FTP service, name this procedure /FILE, and give the process a distinctive name; limit sessions to 1 (to prevent clashes): /LIMIT=1

Now use this service to upload your files.

If you need more concurrent sessions, be sure to serialize and prevent time-out....
Willem Grooters
OpenVMS Developer & System Manager
Willem Grooters
Honored Contributor

Re: Stop Version Numbers on a file

To clearify:

> When done, do a PURGE of all files and rename the remaining failes to version 1.>

meant to be the adjustment in the copy of TCPIP$FTP_RUN.COM:

...
$ RUN SYS$SYSTEM:TCPIP$FTP_SERVER.EXE
$!
$!---Adjust below vvvv
$ PURGE/LOG
$ RENAME *.*;0 ;1 ! or similar, in code
$!---Adjust above ^^^^
$ EXIT

(You can actually do ANY command, even SET DEFAULT, allow specific users only, take other activity based on whatever user of system is accessing the service..)


Willem Grooters
OpenVMS Developer & System Manager
Thomas Ritter
Respected Contributor

Re: Stop Version Numbers on a file

Shelly, we run two large scale commercial ftp drop boxes moving hundreds of files amounting to gigabytes of data every day, one linux based, the other VMS based. Down here, all files which move between these drop boxes have a timestamp embedded somewhere in the file name. This way we only ever have 1 version of any file. Consider the use of timestamps in file names.