Re: Easy DCL question PURGE vs. DELETE - VMS

This is a discussion on Re: Easy DCL question PURGE vs. DELETE - VMS ; briggs@encompasserve.org wrote on 08/07/2007 02:10:59 PM: > In article > 005BDD83@metso.com >, 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 ...

+ 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




    briggs@encompasserve.org wrote on 08/07/2007 02:10:59 PM:

    > In article > 005BDD83@metso.com>, 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)


    So if I have this and use

    PURGE/BEFORE="2-AUG-2007" FOO.BAR

    FOO.BAR;15 7-AUG-2007 14:30:02.26
    FOO.BAR;14 7-AUG-2007 12:30:02.51
    FOO.BAR;13 7-AUG-2007 10:30:01.54
    FOO.BAR;12 7-AUG-2007 06:30:03.77
    FOO.BAR;11 6-AUG-2007 12:30:01.07
    FOO.BAR;10 6-AUG-2007 10:30:02.25
    FOO.BAR;9 6-AUG-2007 06:30:04.56
    FOO.BAR;8 3-AUG-2007 12:30:01.06
    FOO.BAR;7 3-AUG-2007 10:30:02.01
    FOO.BAR;6 3-AUG-2007 06:30:03.75
    FOO.BAR;5 2-AUG-2007 12:30:01.21
    FOO.BAR;4 2-AUG-2007 10:30:02.12
    FOO.BAR;3 2-AUG-2007 06:30:02.62
    FOO.BAR;2 1-AUG-2007 12:30:01.11
    FOO.BAR;1 1-AUG-2007 10:30:01.56

    will versions 2 and 1 be deleted, or
    just version 1?


  2. Re: Easy DCL question PURGE vs. DELETE

    In article , norm.raphael@metso.com writes:
    > briggs@encompasserve.org wrote on 08/07/2007 02:10:59 PM:

    [snip]
    >> 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.
    >>

    [snip]
    > So if I have this and use
    >
    > PURGE/BEFORE="2-AUG-2007" FOO.BAR
    >
    > FOO.BAR;15 7-AUG-2007 14:30:02.26
    > FOO.BAR;14 7-AUG-2007 12:30:02.51
    > FOO.BAR;13 7-AUG-2007 10:30:01.54
    > FOO.BAR;12 7-AUG-2007 06:30:03.77
    > FOO.BAR;11 6-AUG-2007 12:30:01.07
    > FOO.BAR;10 6-AUG-2007 10:30:02.25
    > FOO.BAR;9 6-AUG-2007 06:30:04.56
    > FOO.BAR;8 3-AUG-2007 12:30:01.06
    > FOO.BAR;7 3-AUG-2007 10:30:02.01
    > FOO.BAR;6 3-AUG-2007 06:30:03.75
    > FOO.BAR;5 2-AUG-2007 12:30:01.21
    > FOO.BAR;4 2-AUG-2007 10:30:02.12
    > FOO.BAR;3 2-AUG-2007 06:30:02.62
    > FOO.BAR;2 1-AUG-2007 12:30:01.11
    > FOO.BAR;1 1-AUG-2007 10:30:01.56
    >
    > will versions 2 and 1 be deleted, or
    > just version 1?


    Playing fair and making the prediction before testing it...

    Both versions 2 and 1 will be deleted.

    /KEEP is not specified. That means /KEEP=1
    Version 15 is the highest existing version. It is retained.
    That satisfies the /KEEP count.
    All lower versions matching the /BEFORE will be deleted.
    That means versions 2 and 1.

    And the test...

    Directory EISNER$DRA3:[DECUSERVE_USER.BRIGGS]

    FOO.BAR;19 7-AUG-2007 14:44:53.51
    FOO.BAR;18 7-AUG-2007 14:44:52.69
    FOO.BAR;17 7-AUG-2007 14:44:51.57
    FOO.BAR;16 7-AUG-2007 14:44:50.87
    FOO.BAR;15 7-AUG-2007 14:44:48.31
    FOO.BAR;14 7-AUG-2007 14:44:47.52
    FOO.BAR;13 7-AUG-2007 14:44:46.96
    FOO.BAR;12 7-AUG-2007 14:44:46.37
    FOO.BAR;11 7-AUG-2007 14:44:45.72
    FOO.BAR;10 7-AUG-2007 14:44:44.24 ! Not matching
    FOO.BAR;9 7-AUG-2007 14:44:43.24 ! Matching
    FOO.BAR;8 7-AUG-2007 13:01:12.37 ! Matching

    Total of 12 files.
    $ purge foo.bar /before=14:44:44 /log
    %PURGE-I-FILPURG, EISNER$DRA3:[DECUSERVE_USER.BRIGGS]FOO.BAR;9 deleted (0
    blocks
    )
    %PURGE-I-FILPURG, EISNER$DRA3:[DECUSERVE_USER.BRIGGS]FOO.BAR;8 deleted (0
    blocks
    )
    %PURGE-I-TOTAL, 2 files deleted (0 blocks)
    $
    >


  3. Re: Easy DCL question PURGE vs. DELETE

    On Aug 7, 2:49 pm, bri...@encompasserve.org wrote:
    > In article , norm.raph...@metso.com writes:
    >
    >
    >
    > > bri...@encompasserve.org wrote on 08/07/2007 02:10:59 PM:

    > [snip]
    > >> 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.

    >
    > [snip]
    > > So if I have this and use

    >
    > > PURGE/BEFORE="2-AUG-2007" FOO.BAR

    >
    > > FOO.BAR;15 7-AUG-2007 14:30:02.26
    > > FOO.BAR;14 7-AUG-2007 12:30:02.51
    > > FOO.BAR;13 7-AUG-2007 10:30:01.54
    > > FOO.BAR;12 7-AUG-2007 06:30:03.77
    > > FOO.BAR;11 6-AUG-2007 12:30:01.07
    > > FOO.BAR;10 6-AUG-2007 10:30:02.25
    > > FOO.BAR;9 6-AUG-2007 06:30:04.56
    > > FOO.BAR;8 3-AUG-2007 12:30:01.06
    > > FOO.BAR;7 3-AUG-2007 10:30:02.01
    > > FOO.BAR;6 3-AUG-2007 06:30:03.75
    > > FOO.BAR;5 2-AUG-2007 12:30:01.21
    > > FOO.BAR;4 2-AUG-2007 10:30:02.12
    > > FOO.BAR;3 2-AUG-2007 06:30:02.62
    > > FOO.BAR;2 1-AUG-2007 12:30:01.11
    > > FOO.BAR;1 1-AUG-2007 10:30:01.56

    >
    > > will versions 2 and 1 be deleted, or
    > > just version 1?

    >
    > Playing fair and making the prediction before testing it...
    >
    > Both versions 2 and 1 will be deleted.
    >
    > /KEEP is not specified. That means /KEEP=1
    > Version 15 is the highest existing version. It is retained.
    > That satisfies the /KEEP count.
    > All lower versions matching the /BEFORE will be deleted.
    > That means versions 2 and 1.
    >
    > And the test...
    >
    > Directory EISNER$DRA3:[DECUSERVE_USER.BRIGGS]
    >
    > FOO.BAR;19 7-AUG-2007 14:44:53.51
    > FOO.BAR;18 7-AUG-2007 14:44:52.69
    > FOO.BAR;17 7-AUG-2007 14:44:51.57
    > FOO.BAR;16 7-AUG-2007 14:44:50.87
    > FOO.BAR;15 7-AUG-2007 14:44:48.31
    > FOO.BAR;14 7-AUG-2007 14:44:47.52
    > FOO.BAR;13 7-AUG-2007 14:44:46.96
    > FOO.BAR;12 7-AUG-2007 14:44:46.37
    > FOO.BAR;11 7-AUG-2007 14:44:45.72
    > FOO.BAR;10 7-AUG-2007 14:44:44.24 ! Not matching
    > FOO.BAR;9 7-AUG-2007 14:44:43.24 ! Matching
    > FOO.BAR;8 7-AUG-2007 13:01:12.37 ! Matching
    >
    > Total of 12 files.
    > $ purge foo.bar /before=14:44:44 /log
    > %PURGE-I-FILPURG, EISNER$DRA3:[DECUSERVE_USER.BRIGGS]FOO.BAR;9 deleted (0
    > blocks
    > )
    > %PURGE-I-FILPURG, EISNER$DRA3:[DECUSERVE_USER.BRIGGS]FOO.BAR;8 deleted (0
    > blocks
    > )
    > %PURGE-I-TOTAL, 2 files deleted (0 blocks)
    > $
    >
    >


    Yes, and the logic is:

    FOO.BAR;19 7-AUG-2007 14:44:53.51 !new file; keep highest version;
    count=1
    FOO.BAR;18 7-AUG-2007 14:44:52.69 !no match; skip
    FOO.BAR;17 7-AUG-2007 14:44:51.57 !no match; skip
    FOO.BAR;16 7-AUG-2007 14:44:50.87 !no match; skip
    FOO.BAR;15 7-AUG-2007 14:44:48.31 !no match; skip
    FOO.BAR;14 7-AUG-2007 14:44:47.52 !no match; skip
    FOO.BAR;13 7-AUG-2007 14:44:46.96 !no match; skip
    FOO.BAR;12 7-AUG-2007 14:44:46.37 !no match; skip
    FOO.BAR;11 7-AUG-2007 14:44:45.72 !no match; skip
    FOO.BAR;10 7-AUG-2007 14:44:44.24 !no match; skip
    FOO.BAR;9 7-AUG-2007 14:44:43.24 !Match; incr count;
    count.gt.keep; delete
    FOO.BAR;8 7-AUG-2007 13:01:12.37 !Match; incr count;
    count.gt.keep; delete

    If you added: /KEEP=2 only FOO.BAR;8 would be deleted. /KEEP=3 and
    nothing would be deleted.



+ Reply to Thread