Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy directory hierachy on OpenVMS

SOLVED
Go to solution
Samshen
Frequent Advisor

Copy directory hierachy on OpenVMS

Hi,
I want to copy the whole directory including the subdirectories into another directory.
E.g. the directory1 from disk1: into disk2:.

$copy disk1:[directory1]*.*;* disk2:

it does not create [directory1] under disk2:, but rather copies only files from [directory1] and not its subdirectories.

Please help me with the right command.
7 REPLIES
Hein van den Heuvel
Honored Contributor

Re: Copy directory hierachy on OpenVMS


In OpenVMS use "..." to specify "-R"

$copy disk1:[directory1...]*.*;* disk2:
Jan van den Ende
Honored Contributor
Solution

Re: Copy directory hierachy on OpenVMS

Samshen,
ein wrote:

H
>>>
In OpenVMS use "..." to specify "-R"

$copy disk1:[directory1...]*.*;* disk2:
<<<

which is how you get ALL files into one directory.

If you also want to create the subdirectory structure, then also use BACKUP

$ BACKUP disk1:[dir1...] disk2:[dir2...]

If dir2 is to be the same name as dir1, it may be replaced with disk2:[*...]

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Heuser-Hofmann
Frequent Advisor

Re: Copy directory hierachy on OpenVMS

Use backup:

$ backup disk1:[dir1...] disk2:[*...]/ow=orig

Eberhard
Robert Gezelter
Honored Contributor

Re: Copy directory hierachy on OpenVMS

Samshen,

BACKUP is generally the most appropriate tool to do this task within a single system.

I would recommend a careful reading of the HELP text related to the correct use of the /BY_OWNER. Generally, the safest option is /BY_OWNER=PARENT, but other values are appropriate in some situations.

- Bob Gezelter, http://www.rlgsc.com
Jan van den Ende
Honored Contributor

Re: Copy directory hierachy on OpenVMS

Re Bob

>>>
Generally, the safest option is /BY_OWNER=PARENT, but
<<<

Personally, I feel A LOT more comfortable with /BY_OWNER=ORIGINAL.

Parent directories have a nasty habit of being owned by SYSTEM or [1,1]; and if the protections are decent then noone can access the result.
Another effect goes with it: /BY_OWNER=ORIGINAL also preserves the original protection (including ACLs) where /BY_OWNER=PARENT propagates the parent security. Usually preserving the original settings is the desired behavior, but of course that is depending on the need.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Hans Vlems
Occasional Visitor

Re: Copy directory hierachy on OpenVMS

Yes, /Owner=original is usually what you'd want. However, on systems where ownership of the parent directories of the user files is strictly managed, the UIC of the target directory is prefered if not enforced.
Hans
Robert Gezelter
Honored Contributor

Re: Copy directory hierachy on OpenVMS

Jan, and Hans,

Directories created for users are normally created as owned by the user's UIC. Copying a tree from one user to another would be /BY_OWNER=PARENT (since the root level directories would be correctly owned).

If one is using BACKUP create a root level directory for a user, as well as the contents of the tree, one wants neither ORIGINAL nor PARENT; one wants the UIC of the new user who is to own the directory tree.

Note the implications for utilities such as MAIL, which presume ownership (or at least read/write access) to files.

- Bob Gezelter, http://www.rlgsc.com