Operating System - OpenVMS
1830231 Members
1708 Online
109999 Solutions
New Discussion

BACKUP Utility - directory tree, relative path

 
Peter Hargas
New Member

BACKUP Utility - directory tree, relative path

Hi folks,

I have a question about OpenVMS BACKUP command. I want back-up specified directory and subdirectories (for example: DISK:[PATH.TO.DIR]*.*). But if I want restore the BCK file to dir OTHER_DISK:[OTHER.PATH.TO.DIR], i don't want create subdirectories OTHER_DIS:[OTHER.PATH.TO.DIR.PATH.TO.DIR]. In dir OTHER_DISK:[OTHER.PATH.TO.DIR] i want only files from directory DISK:[PATH.TO.DIR]*.* and no subdir [PATH.TO.DIR].

It is a special parameter of BACKUP command or something ?

Thank you very much for answer !
12 REPLIES 12
Heinz W Genhart
Honored Contributor

Re: BACKUP Utility - directory tree, relative path

Hi Peter

If I have to do something like this, I do it as follows:

I woud create concealed devices

def/sys/exec/trans=(term,conceal) src DISK:[PATH.TO.DIR.]

def/sys/exec/trans=(term,conceal) dst OTHER_DISK:[OTHER.PATH.TO.DIR.]

You can then do the Backup with the following command:

BACKUP/LOG src:[000000...]*.* dst:[*...]*.*

This should give the result as initialy expected.

Hope that helps

Regards

Heinz
Karl Rohwedder
Honored Contributor

Re: BACKUP Utility - directory tree, relative path

This can be done with usage of the ... construct. But I must admit, that sometimes the resultis not what I expected, si a /LOG is usefull.
For your example see here:
DS10_Kalle. sd dqa0:0
DQA0:[000000]
DS10_Kalle. create/dir
DS10_Kalle. cop tt: a.a
DS10::iTKalle@TNA3 12:07:42 COPY CPU=00:00:00.96 PF=3455 IO=2232 MEM=177
Copying: TT:[].; (0% completed)
0 blocks copied of 0
Exit
%COPY-S-COPIED, TT: copied to DQA0:A.A;1 (0 records)
DS10_Kalle. cop tt: b.b
Exit
%COPY-S-COPIED, TT: copied to DQA0:B.B;1 (0 records)
DS10_Kalle. back/log *.* sc:a.bck/save
%BACKUP-S-COPIED, copied DQA0:[PATH]TO.DIR;1
%BACKUP-S-COPIED, copied DQA0:[PATH.TO]DIR.DIR;1
%BACKUP-S-COPIED, copied DQA0:[PATH.TO.DIR]A.A;1
%BACKUP-S-COPIED, copied DQA0:[PATH.TO.DIR]B.B;1
DS10_Kalle. create/dir
DS10_Kalle. back/log sc:a.bck/save *.*
%BACKUP-S-CREDIR, created directory DQA0:[OTHERDIR.PATH.TO]
%BACKUP-S-CREDIR, created directory DQA0:[OTHERDIR.PATH.TO.DIR]
%BACKUP-S-CREATED, created DQA0:[OTHERDIR.PATH.TO.DIR]A.A;1
%BACKUP-S-CREATED, created DQA0:[OTHERDIR.PATH.TO.DIR]B.B;1


regards Kalle
Jan van den Ende
Honored Contributor

Re: BACKUP Utility - directory tree, relative path

Peter,

Let me start with:

WELCOME to the VMS Forum!

The Heinz solution is the one I prefer.... _IF_ tis is a dedicated saveset ANDI also control the RECORDING of the saveset. But, regrettably, that is not always the case,
Often (especially in the case where you need to restore just one tree from a regular (ie, total) backup) you do not know in advance WHICH tree you will need to restore.

For those cases, BACKUP has the /SELECT qualifier.
This should be combined with a mactching output file specification.

In your case:

BACKUP /SELECT=[PATH...] [OTHER.PATH...]

In your /SELECT you specify exactly all of the specification you want to be NO part of your output, in your output you specify that part of the destination that is NOT in the saveset.
In Unix speak: you specify the input and output mount points, and down from there the relative paths are identical.


hth.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Robert Gezelter
Honored Contributor

Re: BACKUP Utility - directory tree, relative path

Peter,

If I understand your question correctly, I concur with Jan. The /SELECT qualifier is the way to extract the contents of a particular directory in a tree from a saveset containing many directories.

In a slightly different scenario, this is precisely the way that one would restore a single user's files from a backup of the entire user disk.

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

Re: BACKUP Utility - directory tree, relative path

and to be complete:

_IF_ the intention is a restore to the original situation. specify /OWNER=ORIGINAL to maintain the security settings from the original.
If you are restoring something (say, a delivered software package) into an environment of your site's security, specify /OWN=PARENT.
If /OWNER is not specified, the execuring process becomes the owner, and the default setting for that process at the time of execution becomes the protection.

-- just another EUR 0.02

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Peter Hargas
New Member

Re: BACKUP Utility - directory tree, relative path

Thank you guys for quick answer, but i don't think if my question was clear.

I want to create one .bck file. Inside this file are only directories and files in path DISK:[SOME.PATH]*.*;* but no directory SOME and PATH. Then i want to extract this archive to other machine.

Peter
Volker Halle
Honored Contributor

Re: BACKUP Utility - directory tree, relative path

Peter,

save with:

$ BACKUP disk:[some.path]*.*;* X.BCK/SAVE

restore with:

$ BACKUP X.BCK/SAVE/SEL=*.*;* disk:[what.you.want]*.*/BY_OWN=ORIGINAL

Note that this does NOT save any subdiretories below [some.path] !

Volker.
Robert Gezelter
Honored Contributor

Re: BACKUP Utility - directory tree, relative path

Peter,

If you only want the files in DISK:[PATH.TO.DIR] (only data files in that directory, no subdirectory files and no files below that directory in the tree) the correct command would be:

$ BACKUP DISK:[PATH.TO.DIR]*.*/EXCLUDE=*.DIR savesetname/SAVE

Depending upon your environment, you may want other options relating to ACLs and UICs, such as /INTERCHANGE.

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

Re: BACKUP Utility - directory tree, relative path

Peter,

Now that your question has become clearer, you should read again the first answer (by Heinz).

First, you define your desired "anchor point" as a concealde device $ DEFINE/TRANS=CONCEAL src DISK:[PATH.TO.DIR.]
Note the full stop just before the closing ], it is essential in this syntax.
Then, BACKUP the "device" src:[*...]
(the 3 ... specify all sub-dirs and their contents.
Note: if you want ONLY the highest version of the files, then specify src:[*...]*.*;0

If you are transfering on anything but VMS then multiple versions will be a nuisance (but then again, restoring a saveset itself will also).

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Robert_Boyd
Respected Contributor

Re: BACKUP Utility - directory tree, relative path

I'm surprised I haven't seen the obvious correlary to the $ DEFINE SOURCE command.

$ define source/translation=concealed DISK_DEVICE:
$ backup source:[PATH.TO.DIR]*.* save.set/save
$ define/trans=concealed destination OTHER_DISK_DEVICE:[OTHER.]
$ backup save.set/saveset destination:[*...]

This will recreate the structure that the backup was made from under the root defined in the definition for "destination." This will work whether the original selection for the backup was from a directory tree or a single directory, list of files or even a single file.

Robert
Master you were right about 1 thing -- the negotiations were SHORT!
Jan van den Ende
Honored Contributor

Re: BACKUP Utility - directory tree, relative path

Robert,

Please re-read the original question, and the clarification thereoff.
Like you say in your answer, your procedure will re-create the original path, ie, _INCLUDING_ PATH.TO.DIR, while the question is to LEAVE OUT that part of the directory structure.
That is what the concealed device input construct does.
Also, the original question states "the directory AND SUBDIRECTORIES.
(my emphasis). And for that, DCL uses the ellipses ( ... )

hth.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Robert_Boyd
Respected Contributor

Re: BACKUP Utility - directory tree, relative path

Jan,

I re-read the original question -- I may have mis-interpreted that Peter doesn't want to have a doubling of the original path name in the created tree. It would be more clear if the PATH.TO.DIR didn't look just like the subtree of OTHER.PATH.TO.DIR

Peter, can you clarify if you are talking about a situation of copying from [A.B.C] to [D.E.F] or are you copying from [A.B.C] to [X.A.B.C] ?

Robert
Master you were right about 1 thing -- the negotiations were SHORT!