- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Writing a dcl script to delete files
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2006 07:20 AM
тАО06-27-2006 07:20 AM
I would like to delete all the TEAM_*_ALL.*;* all the LAWSUIT_CALIF_EXT*.DAT;* and all the LANE_CALIF_EXT*.DAT;* files across all sitesтАЩin the PROD_RMS directories.
Can someone write up a simple script for this, I would appreciate it!
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2006 08:16 AM
тАО06-27-2006 08:16 AM
Solution$ loop:
$ disk = f$device(,"disk")
$ if disk .nes. "" then if f$getdvi(disk,"Mnt")
$ then
$ delete 'disk'[Prod_RMS...]team_*_all.*;*
$ delete 'disk'[Prod_RMS...]lawsuit_calif_ext*.dat;*
$ delete 'disk'[Prod_RMS...]lane_calif_ext*.dat;*
$ goto loop
$ endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2006 08:32 AM
тАО06-27-2006 08:32 AM
Re: Writing a dcl script to delete files
$ loop:
$ disk = f$device(,"disk")
$ if disk .nes. "" then if f$getdvi(disk,"Mnt")
$ then
$ delete 'disk'[Prod_RMS...]team_*_all.*;*
$ delete 'disk'[Prod_RMS...]lawsuit_calif_ext*.dat;*
$ delete 'disk'[Prod_RMS...]lane_calif_ext*.dat;*
$ goto loop
$ endif
If this sctipt would encounter a foreign mounted disk, a shadow set member, a CD drive, a write-locked drive, ..., you would finish without doing all disks.
I suggest a slight modification.
$ loop:
$ disk = f$device(,"disk")
$ if disk .nes. ""
$ then
$ if f$getdvi(disk,"Mnt")
$ then
$ set noon ! proceed if DELETE impossible for any reason
$ delete 'disk'[Prod_RMS...]team_*_all.*;*
$ set noon ! set again (undone at first fai;, but then this one also likely to fail
$ delete 'disk'[Prod_RMS...]lawsuit_calif_ext*.dat;*
$ set noon
$ delete 'disk'[Prod_RMS...]lane_calif_ext*.dat;*
$ goto loop ! seek next disk
$ endif
$ endif
Instead of SET NOON in a decent procedure I would test the various statusses a disk could be in that would lead to error, but this looks like a one-timer, and then the quick-and-dirty is the cheaper solution.
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2006 08:32 AM
тАО06-27-2006 08:32 AM
Re: Writing a dcl script to delete files
On all nodes if I do dir prod_rms:TEAM_*_ALL.*;*
Now the prod_rms is a log pointing to the actual device where prod_rms directory is located. The files are there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2006 08:37 AM
тАО06-27-2006 08:37 AM
Re: Writing a dcl script to delete files
$ Set NoOn
$ Delete Prod_RMS:team_*_all.*;*
$ Delete Prod_RMS:Lawsuit_Calif_Ext*.dat;*
$ Delete Prod_RMS:Lane_Calif_ext*.dat;*
I don't think I'd even call that a script... ;^)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2006 08:40 AM
тАО06-27-2006 08:40 AM
Re: Writing a dcl script to delete files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-27-2006 10:54 AM
тАО06-27-2006 10:54 AM
Re: Writing a dcl script to delete files
Perhaps a "$ delete/erase" is in order.
From vms help
DELETE
file
/ERASE
/ERASE
/NOERASE (default)
When you delete a file, the area in which the file was stored is
returned to the system for future use. The data that was stored
in that location still exists in the system until new data is
written over it. When you specify the /ERASE qualifier, the
storage location is overwritten with a system specified pattern
so that the data no longer exists.
Also does the disk have highwater marking enabled ?
SET
VOLUME
/HIGHWATER_MARKING
/HIGHWATER_MARKING
/NOHIGHWATER_MARKING
Determines whether the file highwater mark (FHM) volume attribute
is set. The FHM attribute guarantees that a user cannot read data
that was not written by the user. Applies to Files-11 On-Disk
Structure Level 2 (ODS-2) and 5 (ODS-5) volumes only.
Why mention this ? DFU has a facility to "UNDELETE" files. We deal with sensitive data and when we delete the files, they are deleted and stay deleted !
my aus 0.02
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2006 07:54 AM
тАО06-28-2006 07:54 AM
Re: Writing a dcl script to delete files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2006 07:54 AM
тАО06-28-2006 07:54 AM
Re: Writing a dcl script to delete files
If a lot, it may well be worth writing a script to delete them in reverse order.
When VMS deletes a file it shuffles all of the alphabetically higher directory entries down. This makes for a fast read of the directory next time round, but if the directory file itself is large the shuffle can take a while, and is repeated for every file deleted.
Doing the deletes in reverse order reduces (or even eliminates) that shuffling as there are fewer, if any, directory entries above the deleted file to shuffle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2006 04:51 PM
тАО06-28-2006 04:51 PM
Re: Writing a dcl script to delete files
reverse deletion of large number of files.
I attach mine to give you an idea.
regards Kalle