- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- rename path issue [ newbie question]
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
Forums
Discussions
Discussions
Discussions
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
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
08-08-2005 02:22 PM
08-08-2005 02:22 PM
I am trying to move directory and it's subdirectories and all their contents from
disk1:[acct1.data]dirTOMOVE to
disk1:[ACCT2.data]dirTOMOVE
so I did
$rename disk1:[acct1.data.dirTOMOVE...]*.*;* disk1:[ACCT2.data]*.*;*
However, this copies the subdirectories directly to the data folder
so I have disk1:[ACCT2.data.subdir] instead of disk1:[ACCT2.data.dirTOMOVE.subdir]
Please let me know what you think
Thanks in advance
Nipun
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2005 03:11 PM
08-08-2005 03:11 PM
Re: rename path issue [ newbie question]
You've got the answer in your description... Try:
$ RENAME/LOG -
DISK1:[ACCT1.DATA]DIRTOMOVE.DIR -
DISK1:[ACCT2.DATA]DIRTOMOVE.DIR
This will move the directory file (and all its contents). Good policy to use /LOG, especially if you're unsure what's going to happen.
Note that if ACCT1 and ACCT2 are owned by different users, you may want to reset the file ownerships as well:
$ SET DIRECTORY/OWNER=acct2 DISK1:[ACCT2.DATA.DIRTOMOVE]
$ SET FILE/OWNER=acct2 DISK1:[ACCT2.DATA.DIRTOMOVE...]*.*;*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2005 08:01 PM
08-08-2005 08:01 PM
Re: rename path issue [ newbie question]
directory in vms are file with .DIR extension.
Rename can work just on the same disk.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2005 08:09 PM
08-08-2005 08:09 PM
Re: rename path issue [ newbie question]
WADR (with all due respect), I believe that John omitted an important case in his answer.
John discussed the very common case of renaming a directory from one name to another. His answer is completely correct, as is his well noted comment about file ownership. To his comment, I will add a comment about the File Protection Masks and Access Control Lists (ACLS), which also may require adjustment, depending on your security issues.
John's answer, did however, omit the possibility that the RENAME operation was a merge of the files contained in disk1:[acct1.data...] with the contents of the directory tree disk1:[ACCT2.data...].
In that case, your RENAME command should be:
$ RENAME/LOG disk1:[acct1.data...]*.*;* disk1:[ACCT2.data...]*.*;*
Two things to note about the above:
- first, the ellipsis (...) on both source and the destination are critical
- the /LOG output will not include files (or for that matter, directories) that are included in sub-directories that are moved in total when the sub-directory is renamed.
Note that the use of RENAME only works for the same device, if the devices are different, BACKUP is the preferred utility.
I hope that the above is helpful.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2005 09:11 PM
08-08-2005 09:11 PM
Re: rename path issue [ newbie question]
Q
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2005 10:03 PM
08-08-2005 10:03 PM
Re: rename path issue [ newbie question]
Yes, BACKUP is a good option. However, Nipun did not specify the size (or for that matter, the allocations) of the files in the original directory tree.
If the files are large, of they are specially allocated (e.g., contiguous, placement control), or if there is not enough space for two copies of the files on the disk, RENAME is Nipun's best option.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 01:29 AM
08-09-2005 01:29 AM
Re: rename path issue [ newbie question]
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 02:54 AM
08-09-2005 02:54 AM
Re: rename path issue [ newbie question]
yeah I the files are huge and on the same disk so renaming is the only option I have and I have to be careful.
when I do
$ RENAME/LOG -
DISK1:[ACCT1.DATA]DIRTOMOVE.DIR -
DISK1:[ACCT2.DATA]DIRTOMOVE.DIR
Does this mean I need to have DIRTOMOVE.DIR already created in ACCT2 before hand?
in order to effectively copy all the subdirectories in the right order.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 03:08 AM
08-09-2005 03:08 AM
Re: rename path issue [ newbie question]
ACCT2 can't exist, so can't exit its subdirectory.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 03:14 AM
08-09-2005 03:14 AM
Re: rename path issue [ newbie question]
>>> when I do $ RENAME/LOG -
DISK1:[ACCT1.DATA]DIRTOMOVE.DIR -
DISK1:[ACCT2.DATA]DIRTOMOVE.DIR
>Does this mean I need to have DIRTOMOVE.DIR >already created in ACCT2 before hand?
Yes.
You will also need to unprotect the directories before delete or rename as by default they are protected against delete.
Now you are not deleting, only writing, but changing directory entries can 'appear' to look like deleting (both cases can result in 'file not found' :-).
What I tend to do is a simple, sleazy: SET PROT xxx.DIR.
This will apply the default file protection which will allow delete.
You should reset afterwards, but you can not delete non-empty directories anyway.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 03:53 AM
08-09-2005 03:53 AM
Re: rename path issue [ newbie question]
$rename disk1:[acct1.data.dirTOMOVE...]*.*;* disk1:[ACCT2.data.dirTOMOV...]*.*;*
and
$rename disk1:[acct1.data.dirTOMOVE...]*.*;* disk1:[ACCT2.data.dirTOMOV]*.*;*
Note: I need to move the directory and all it's subdirectories and their contents. The data is very critical so need to understand clearly what I am doing.
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 03:54 AM
08-09-2005 03:54 AM
Re: rename path issue [ newbie question]
Does this mean I need to have DIRTOMOVE.DIR already created in ACCT2 before hand?
No or Yes?
Because Hein and me have different point of view I try to explain better.
[No]
If ACCT2 doesn't exist, ACCT1 is renamed as is keeping source owner (of ACCT1).
[Yes]
If ACCT2 exists (and/or its subdirectory) command can't rename directory (because it alredy exists), send you an error message and keeps taregt owner (of ACCT2).
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 04:03 AM
08-09-2005 04:03 AM
Re: rename path issue [ newbie question]
if I do the following
$rename disk1:[acct1.data]dirTOMOVE.dir - disk1:[ACCT2.data]
won't this entirely solve my problem?
Basically, it will copy all the contents and sub directories of dirTOMOVE.dir to disk1:[ACCT2.data]
I already have disk1:[ACCT2.data ] setup.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 04:19 AM
08-09-2005 04:19 AM
Re: rename path issue [ newbie question]
when I do
$ RENAME/LOG -
DISK1:[ACCT1.DATA]DIRTOMOVE.DIR -
DISK1:[ACCT2.DATA]DIRTOMOVE.DIR
Does this mean I need to have DIRTOMOVE.DIR already created in ACCT2 before hand?
To this, Hein answered "Yes"
I am sorry, but have to ABSOLUTELY disagree!!
The (special) file DIRTOMOVE.DIR always has version ;1.
It has to, if it is be able to functon as a DIRECTORY.
Now, if it already exists in [acct2.data], the RENAME will already find a ;1 , and generate ;2
Now there are TWO versions of the .DIR file, and you are in for some nasty surprises!
Those may be summarised by: YOU DO NOT WANT THIS!!!
So, the answer to the quoted question HAS to be NO, it does NOT have to exist, at should NOT exist!!
And Antonio's "RENAME will give an error" also is INCORRECT! It just creates ;2
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 04:23 AM
08-09-2005 04:23 AM
Re: rename path issue [ newbie question]
sorry, sorry sorry.
I wrong :-(
Don't read my previous posts.
$rename disk1:[acct1.data]dirTOMOVE.dir - disk1:[ACCT2.data]
1.Directory [ACCT2.data] has to exist;
2.After rename all files and subdirectory are moved in new folder
3.Directory [ACCT1.DATA] stay empty
4.Directory [ACCT2.DATA] contains all files and directory.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 04:27 AM
08-09-2005 04:27 AM
Re: rename path issue [ newbie question]
I believe that Hein mis-spoke (wrote).
Obviously, before doing any of these operations with real files, create a sample directory tree with a population of files and experiment until you are comfortable that you understand what is happening.
It takes only a few seconds to create a group of nested subdirectories a few levels deep, each with some non-directory files. Do the RENAME/LOG operation on this tree and you will see how the mechanics of RENAME operate without working with live data.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 04:27 AM
08-09-2005 04:27 AM
Re: rename path issue [ newbie question]
I never use full path, I usually use path from current directory.
So I didn't read ACCT1/2 is just a level above the current you want to rename.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 05:09 AM
08-09-2005 05:09 AM
Re: rename path issue [ newbie question]
$ rename/log disk1:[000000]acct1.dir disk1:[000000]acct2.dir
I prefer to add /log to all my copy/rename/delete commands.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 05:55 AM
08-09-2005 05:55 AM
SolutionRob> I believe that Hein mis-spoke (wrote).
You guys are right. I mis-read.
I _thought_ he had pre-created an empty directory, which would have to be removed.
My bad.
Dale> all Nipun really wants to do is:
> $ rename/log disk1:[000000]acct1.dir disk1:[000000]acct2.dir
Yes, but he is 'nervous' about it.
Nipun> rename disk1:[acct1.data]dirTOMOVE.dir - disk1:[ACCT2.data]
Nipun> won't this entirely solve my problem?
YES
> Basically, it will copy all the contents and sub directories of dirTOMOVE.dir to disk1:[ACCT2.data]
NO. But this is semantics / nit picking.
It will NOT copy contents or subdirectories.
It will only rename that top directoy.
But that contents and those subdirectories will become visible, will get a path, under that new top just like you desire.
So the desired effect will be there with a single, reversible, sub-second command.
Sorry 'bout mis-reading earlier.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2005 06:38 AM
08-09-2005 06:38 AM
Re: rename path issue [ newbie question]
http://www.vtfm.narod.ru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2005 10:10 AM
08-12-2005 10:10 AM
Re: rename path issue [ newbie question]
Hein your input regarding renaming made things very clear to me.
The tips provided by all were also very helpful.
Nipun