Can you restore just the files under a directory?

ldmwndletsm

ADSM.ORG Senior Member
Joined
Oct 30, 2019
Messages
232
Reaction score
5
Points
0
How in dsmc can you tell it to restore just the contents under a subdirectory but not the subdirectory itself?

For example, I want to restore /data/year/1997/* to /data/year/1997, but I don't want to restore 1997 itself? I don't want to end up with /data/year/1997/1997 (I guess I could move the files one level up and then delete the lower level 1997 directory, sure), and I don't want to change the settings on the 1997 directory that's already out there on disk. I don't want it replacing the 1997 directory.

I could create a temporary directory under that same file system, recover everything there and then move (atomic operation) the files to the desired location, leaving only the 1997 directory in the temp location, and then I delete that and the temp directory.

Is there an easier way? I'm thinking in the rsync mode where you can specify a trailing slash or not depending on whether you want to copy only the contents or the contents and the source directory.
 
Hi, if you want to restore to the original directory it is not necessary to specify the target. To original directory is the default ;)
 
Restore to the original location with the -filesonly option.
 
Eureka! Now that I know that, I just went through the dsmc help pages, and this is all buried down in there. I also see there's a dirsonly counterpart. Didn't look hard enough the other day. I will test this out tonight.

It's easy to find all this in the online documentation after the fact, but it was eluding me earlier. The adsm group to the rescue. :)
 
Back
Top