Re: Easy DCL question PURGE vs. DELETE - VMS

This is a discussion on Re: Easy DCL question PURGE vs. DELETE - VMS ; AEF wrote on 08/07/2007 09:51:35 AM: > On Aug 7, 9:34 am, AEF wrote: > > On Aug 7, 8:38 am, norm.raph...@metso.com wrote: > > > > > Doug Phillips wrote on 08/06/2007 08:21:36 PM: > > > > > ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Re: Easy DCL question PURGE vs. DELETE

  1. Re: Easy DCL question PURGE vs. DELETE




    AEF wrote on 08/07/2007 09:51:35 AM:

    > On Aug 7, 9:34 am, AEF wrote:
    > > On Aug 7, 8:38 am, norm.raph...@metso.com wrote:
    > >
    > > > Doug Phillips wrote on 08/06/2007 08:21:36

    PM:
    > >
    > > > > On Aug 6, 3:48 pm, AEF wrote:
    > > > > > On Aug 6, 1:27 pm, Doug Phillips wrote:
    > > > > > > On Aug 5, 7:17 pm, AEF wrote:
    > > > > > > > On Aug 5, 4:26 pm, Doug Phillips

    wrote:
    > > > > > > > > On Aug 5, 2:10 pm, AEF wrote:
    > > > > > > > > > On Aug 5, 2:20 pm, Doug Phillips

    > net> wrote:
    > > > [8< SNIP >8]

    > >
    > > > > P.S. to Norm: I thought you said "Easy DCL question...":-)

    > >
    > > > Yes, I did, but my instincts were correct that I was missing

    something.
    > > > I just didn't realize how confusing the something is. I am still not
    > > > clear as to what is current behavior - I'll have to do a

    carefulreread of
    > > > the latter posts.

    > >
    > > The command
    > >
    > > $ PURGE/BEFORE=time/KEEP=1
    > >
    > > is the same
    > >
    > > $ DELETE/BEFORE=time/EXCLUDE=;
    > >
    > > if it were a valid command and changing 1 to n would keep n-1 more of
    > > the highest versions that would be deleted if it were still 1.

    >
    > Uh, make that
    >
    > if it were a valid command and changing 1 to n would additionally keep
    > the n-1 highest versions of those that would be deleted if it were
    > still 1.
    >
    > [...]
    >
    > > Here's from the doc:
    > >
    > > *** The PURGE command deletes earlier versions of files. ***
    > >
    > > [OK, this means that PURGE deletes *EARLIER* (non-current) versions of
    > > files.]
    > >
    > > *** BEFORE[=time]
    > > Selects only those files dated prior to the specified time. You can
    > > specify time as absolute time, as a combination of absolute and delta
    > > times, or as one of the following keywords: BOOT, LOGIN, TODAY
    > > (default), TOMORROW, or YESTERDAY. Specify one of the following
    > > qualifiers with the /BEFORE qualifier to indicate the time attribute
    > > to be used as the basis for selection: /BACKUP, /CREATED (default), /
    > > EXPIRED, or /MODIFIED. ***
    > >
    > > [OK, this tells you *which* of the earlier files to delete. It's
    > > simple: PURGE deletes earlier [non-current] versions of files and /
    > > BEFORE narrows down which of those earlier [non-current] versions to
    > > delete!]
    > >
    > > /KEEP=number-of-versions
    > > Specifies the maximum number of versions of the specified files to be
    > > retained in the directory. If you do not include the /KEEP qualifier,
    > > all but the highest numbered version of the specified files are
    > > deleted from the directory.
    > >
    > > [OK, this needs some serious improvement. I find it ambiguous even
    > > when other qualifiers are not specified at all. I'd say /KEEP=1 means
    > > keep the current version of each file and /KEEP=n keeps n-1 of the
    > > highest versions of the files subject to deletion.]

    >
    > Uh, make that
    >
    > [OK, this needs some serious improvement. I find it ambiguous even
    > when other qualifiers are not specified at all. I'd say /KEEP=1 means
    > keep the current version of each file and /KEEP=n means keep the
    > current version and the n-1 highest versions of the files subject to
    > deletion.]
    >
    > > > -Norm

    > >
    > > > --------------------
    > > > "Everything worthwhile eventually degenerates into real work."

    -Murphy
    > >
    > > AEF

    >
    > I apologize for not catching these before posting.
    >
    > AEF
    >

    Ok, so as currently (V7* and above) implemented:
    PURGE/KEEP=1/BEFORE=time
    or
    PURGE/KEEP=n/BEFORE=time
    will consider only versions created before the time specified, then
    purge leaving only the one (or n) version(s) created before the time
    specified
    and all versions created (on or) after the time specified.

    [Time selected, purge rule applied to selection only]

    If I follow the discussion correctly, this does not do the following:
    For keep=n, keep the greater of n versions or the number of versions
    that exist if that is less than n, and of any of the versions greater
    than the n versions that exist, purge only those that were created
    before the time specified. This would delete all files created before
    the time specified if that would still leave at least n versions.

    ISTM both results might fit a requirement and so ways to do each might
    well be put into DCL, but the chance of any retrofit to an earlier
    OpenVMS version before 8.3 would be slight indeed.

    Yes?

    ---------
    that that is is that that is not is not is not that it it is
    (Punctuation left as an exercise for the student.)


  2. Re: Easy DCL question PURGE vs. DELETE

    On Aug 7, 12:43 pm, norm.raph...@metso.com wrote:
    > AEF wrote on 08/07/2007 09:51:35 AM:
    >
    >
    >
    > > On Aug 7, 9:34 am, AEF wrote:
    > > > On Aug 7, 8:38 am, norm.raph...@metso.com wrote:

    >
    > > > > Doug Phillips wrote on 08/06/2007 08:21:36

    > PM:
    >
    > > > > > On Aug 6, 3:48 pm, AEF wrote:
    > > > > > > On Aug 6, 1:27 pm, Doug Phillips wrote:
    > > > > > > > On Aug 5, 7:17 pm, AEF wrote:
    > > > > > > > > On Aug 5, 4:26 pm, Doug Phillips

    > wrote:
    > > > > > > > > > On Aug 5, 2:10 pm, AEF wrote:
    > > > > > > > > > > On Aug 5, 2:20 pm, Doug Phillips
    > > net> wrote:
    > > > > [8< SNIP >8]

    >
    > > > > > P.S. to Norm: I thought you said "Easy DCL question...":-)

    >
    > > > > Yes, I did, but my instincts were correct that I was missing

    > something.
    > > > > I just didn't realize how confusing the something is. I am still not
    > > > > clear as to what is current behavior - I'll have to do a

    > carefulreread of
    > > > > the latter posts.

    >
    > > > The command

    >
    > > > $ PURGE/BEFORE=time/KEEP=1

    >
    > > > is the same

    >
    > > > $ DELETE/BEFORE=time/EXCLUDE=;

    >
    > > > if it were a valid command and changing 1 to n would keep n-1 more of
    > > > the highest versions that would be deleted if it were still 1.

    >
    > > Uh, make that

    >
    > > if it were a valid command and changing 1 to n would additionally keep
    > > the n-1 highest versions of those that would be deleted if it were
    > > still 1.

    >
    > > [...]

    >
    > > > Here's from the doc:

    >
    > > > *** The PURGE command deletes earlier versions of files. ***

    >
    > > > [OK, this means that PURGE deletes *EARLIER* (non-current) versions of
    > > > files.]

    >
    > > > *** BEFORE[=time]
    > > > Selects only those files dated prior to the specified time. You can
    > > > specify time as absolute time, as a combination of absolute and delta
    > > > times, or as one of the following keywords: BOOT, LOGIN, TODAY
    > > > (default), TOMORROW, or YESTERDAY. Specify one of the following
    > > > qualifiers with the /BEFORE qualifier to indicate the time attribute
    > > > to be used as the basis for selection: /BACKUP, /CREATED (default), /
    > > > EXPIRED, or /MODIFIED. ***

    >
    > > > [OK, this tells you *which* of the earlier files to delete. It's
    > > > simple: PURGE deletes earlier [non-current] versions of files and /
    > > > BEFORE narrows down which of those earlier [non-current] versions to
    > > > delete!]

    >
    > > > /KEEP=number-of-versions
    > > > Specifies the maximum number of versions of the specified files to be
    > > > retained in the directory. If you do not include the /KEEP qualifier,
    > > > all but the highest numbered version of the specified files are
    > > > deleted from the directory.

    >
    > > > [OK, this needs some serious improvement. I find it ambiguous even
    > > > when other qualifiers are not specified at all. I'd say /KEEP=1 means
    > > > keep the current version of each file and /KEEP=n keeps n-1 of the
    > > > highest versions of the files subject to deletion.]

    >
    > > Uh, make that

    >
    > > [OK, this needs some serious improvement. I find it ambiguous even
    > > when other qualifiers are not specified at all. I'd say /KEEP=1 means
    > > keep the current version of each file and /KEEP=n means keep the
    > > current version and the n-1 highest versions of the files subject to
    > > deletion.]

    >
    > > > > -Norm

    >
    > > > > --------------------
    > > > > "Everything worthwhile eventually degenerates into real work."

    > -Murphy
    >
    > > > AEF

    >
    > > I apologize for not catching these before posting.

    >
    > > AEF

    >
    > Ok, so as currently (V7* and above) implemented:
    > PURGE/KEEP=1/BEFORE=time
    > or
    > PURGE/KEEP=n/BEFORE=time
    > will consider only versions created before the time specified, then
    > purge leaving only the one (or n) version(s) created before the time
    > specified
    > and all versions created (on or) after the time specified.
    >
    > [Time selected, purge rule applied to selection only]


    Nope. My tests were run on VMS V6.1, 6.2, and 7.2-1 and on none of
    those systems does it work as you described.

    >
    > If I follow the discussion correctly, this does not do the following:
    > For keep=n, keep the greater of n versions or the number of versions
    > that exist if that is less than n, and of any of the versions greater
    > than the n versions that exist, purge only those that were created
    > before the time specified. This would delete all files created before
    > the time specified if that would still leave at least n versions.


    I have no idea what this means.

    One more time!

    Current VMS behavior (directly tested by me for the versions mentioned
    above):

    $ PURGE/BEFORE=time acts as you would expect $ DELETE/BEFORE=time/
    EXCLUDE=; to if it were a valid command. Adding /KEEP=n would
    additionally keep the n-1 highest versions that are before the time
    'time'.

    I don't think I can do better than this.

    > ISTM both results might fit a requirement and so ways to do each might
    > well be put into DCL, but the chance of any retrofit to an earlier
    > OpenVMS version before 8.3 would be slight indeed.
    >
    > Yes?


    Can't answer this.

    >
    > ---------
    > that that is is that that is not is not is not that it it is
    > (Punctuation left as an exercise for the student.)


    AEF


  3. Re: Easy DCL question PURGE vs. DELETE

    In article , norm.raphael@metso.com writes:
    [snip]
    > Ok, so as currently (V7* and above) implemented:
    > PURGE/KEEP=1/BEFORE=time
    > or
    > PURGE/KEEP=n/BEFORE=time
    > will consider only versions created before the time specified, then
    > purge leaving only the one (or n) version(s) created before the time
    > specified
    > and all versions created (on or) after the time specified.


    Not quite. The gotcha is that the highest numbered version counts
    against the /KEEP count regardless of whether it matches the /BEFORE.

    Here's my take based on AEF's explanation.

    Interaction of /KEEP with /BEFORE, /SINCE, /BY_OWNER, /EXCLUDE, etc:

    PURGE will always retain the highest existing file version regardless
    of any file selection criteria or /KEEP[=n] qualifier.

    PURGE will always retain all file versions that fail to match the
    file selection criteria. The only versions that are candidates for
    deletion are those that match all specified criteria.

    If /KEEP=1 or /KEEP is specified or defaulted along with one or more
    file selection criteria then the retention of the highest existing version
    satisfies the /KEEP qualifier. All lower versions that match the
    selection criteria will be purged.

    If /KEEP=n is specified with n>1 along with one or more selection
    criteria then in addition to the highest existing file version,
    the next n-1 versions that match the selection criteria and
    would thus have otherwise been purged will instead be retained.
    All lower versions that match the selection criteria will be purged.

    Examples:

    $ PURGE FOO.BAR /KEEP=2 /BY_OWNER=[1,4]

    FOO.BAR;5 (matches criteria) Retained (highest version always retained)
    FOO.BAR;4 (does not match) Retained (does not match criteria)
    FOO.BAR;3 (matches criteria) Retained (keep count = 2)
    FOO.BAR;2 (does not match) Retained (does not match criteria)
    FOO.BAR;1 (matches criteria) Purged (keep count less than 3)


    $ PURGE FOO.BAR /KEEP=2 /BY_OWNER=[1,4]

    FOO.BAR;5 (does not match) Retained (highest version always retained)
    FOO.BAR;4 (does not match) Retained (does not match criteria)
    FOO.BAR;3 (matches criteria) Retained (keep count = 2)
    FOO.BAR;2 (does not match) Retained (does not match criteria)
    FOO.BAR;1 (matches criteria) Purged (keep count less than 3)


    $ PURGE FOO.BAR /KEEP=1 /BY_OWNER=[1,4]

    FOO.BAR;5 (does not match Retained (highest version always retained)
    FOO.BAR;4 (does not match) Retained (does not match criteria)
    FOO.BAR;3 (matches criteria) Purged (keep count less than 2)
    FOO.BAR;2 (does not match) Retained (does not match criteria)
    FOO.BAR;1 (matches criteria) Purged (keep count less than 3)