Re: Easy DCL question PURGE vs. DELETE
[email]briggs@encompasserve.org[/email] wrote on 08/07/2007 02:10:59 PM:
[color=blue]
> In article <OF1D5A699B.8E8DC919-ON85257330.005A99BC-85257330.
> [email]005BDD83@metso.com[/email]>, [email]norm.raphael@metso.com[/email] writes:
> [snip][color=green]
> > 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.[/color]
>
> 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[/color]
version[color=blue]
> 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[/color]
retained)[color=blue]
> 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[/color]
retained)[color=blue]
> 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[/color]
retained)[color=blue]
> 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)[/color]
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?
Re: Easy DCL question PURGE vs. DELETE
In article <OF8CC93732.C94F19D1-ON85257330.006976DC-85257330.006A391C@metso.com>, [email]norm.raphael@metso.com[/email] writes:[color=blue]
> [email]briggs@encompasserve.org[/email] wrote on 08/07/2007 02:10:59 PM:[/color]
[snip][color=blue][color=green]
>> 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[/color]
> version[color=green]
>> 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.
>>[/color][/color]
[snip][color=blue]
> 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?[/color]
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)
$[color=blue]
>[/color]
Re: Easy DCL question PURGE vs. DELETE
On Aug 7, 2:49 pm, bri...@encompasserve.org wrote:[color=blue]
> In article <OF8CC93732.C94F19D1-ON85257330.006976DC-85257330.006A3...@metso.com>, norm.raph...@metso.com writes:
>
>
>[color=green]
> > bri...@encompasserve.org wrote on 08/07/2007 02:10:59 PM:[/color]
> [snip][color=green][color=darkred]
> >> Interaction of /KEEP with /BEFORE, /SINCE, /BY_OWNER, /EXCLUDE, etc:[/color][/color]
>[color=green][color=darkred]
> >> PURGE will always retain the highest existing file version regardless
> >> of any file selection criteria or /KEEP[=n] qualifier.[/color][/color]
>[color=green][color=darkred]
> >> 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.[/color][/color]
>[color=green][color=darkred]
> >> If /KEEP=1 or /KEEP is specified or defaulted along with one or more
> >> file selection criteria then the retention of the highest existing[/color]
> > version[color=darkred]
> >> satisfies the /KEEP qualifier. All lower versions that match the
> >> selection criteria will be purged.[/color][/color]
>[color=green][color=darkred]
> >> 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.[/color][/color]
>
> [snip][color=green]
> > So if I have this and use[/color]
>[color=green]
> > PURGE/BEFORE="2-AUG-2007" FOO.BAR[/color]
>[color=green]
> > 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[/color]
>[color=green]
> > will versions 2 and 1 be deleted, or
> > just version 1?[/color]
>
> 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)
> $
>
>[/color]
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.