1828235 Members
2349 Online
109975 Solutions
New Discussion

VMS Purge

 
AL MASS_1
New Member

VMS Purge

I am writing a daily com file and would like to purge files for a particular extension and only files older then 30 days. My assumption is that I would use the PURGE or DELETE and parse the creation date somehow. Does anyone have a recommendation or advice?

Al
8 REPLIES 8
David B Sneddon
Honored Contributor

Re: VMS Purge

Al,

$ delete file.type;/created/before=today-30-00:00

Regards
Dave
John Gillings
Honored Contributor

Re: VMS Purge

Al,
if there are multiple versions of the files, you will need to modify David's suggestion slightly:

$ delete file.type;*/created/before=today-30-00:00

I'd also suggest you "practice" with the DIRECTORY command first, just to make sure you're finding the right files:

$ DIRECTORY/DATE=CRE file.type;* /CREATED/BEFORE=TODAY-30-00:00

(handy that so many DCL utilities share the same qualifiers!)
A crucible of informative mistakes
Jan van den Ende
Honored Contributor

Re: VMS Purge

Al,

Welcome to VMS!

Like almost all VMS (DCL) commands:
Questions about what can be done, and what the exact syntax is, are splendidly answered by HELP

In your case:
HELP purge
and then, PURGE Subtopic: /SINCE (it is also quite educational to just go over the other qualifiers, and get a good impression of the various ways to steer to functionality in the direction that suits you best)

I think maybe HELP HELP is the best start.

Success


Jan
Don't rust yours pelled jacker to fine doll missed aches.
AL MASS_1
New Member

Re: VMS Purge

Wow! Thanks everyone!
Al
Wim Van den Wyngaert
Honored Contributor

Re: VMS Purge

I would use /modif instead of /create.

Wim
Wim
Dan Herron
Advisor

Re: VMS Purge

Al,

We use
DELETE/LOG/CREATED/BEFORE=-32-00 file.ext;*

Using 32 instead of 30 ensures the file makes it on to our end of the month backup tapes since some months of the year have 31 days. We perform daily backups (of course!) but the daily backup from the last day of the month is sent offsite and not rotated back in for at least a year.

Moral of the Story: Make sure your DELETE policy is in tune with your BACKUP policy.

Good luck,
Dan Herron
Ian Miller.
Honored Contributor

Re: VMS Purge

Welcome to the forum - I'm sure you will find it helpful. Remember to award points to the people who have used their valuable time to answer your question.
http://forums1.itrc.hp.com/service/forums/helptips.do?#28
____________________
Purely Personal Opinion
AL MASS_1
New Member

Re: VMS Purge

Thanks for all the great information. I appreciate everyone's input.

Al