$host:/$strippedShare$f | $In{hostDest}:/$strippedShareDest$targetFile |
EOF
@@ -232,6 +293,9 @@ EOF
$reqFileName = "restoreReq.$$.$i";
last if ( !-f "$TopDir/pc/$hostDest/$reqFileName" );
}
+ my $inPathHdr = $In{pathHdr};
+ $inPathHdr = "/$inPathHdr" if ( $inPathHdr !~ m{^/} );
+ $inPathHdr = "$inPathHdr/" if ( $inPathHdr !~ m{/$} );
my %restoreReq = (
# source of restore is hostSrc, #num, path shareSrc/pathHdrSrc
num => $In{num},
@@ -242,7 +306,7 @@ EOF
# destination of restore is hostDest:shareDest/pathHdrDest
hostDest => $hostDest,
shareDest => $In{shareDest},
- pathHdrDest => $In{pathHdr},
+ pathHdrDest => $inPathHdr,
# list of files to restore
fileList => \@fileList,
@@ -255,6 +319,8 @@ EOF
[ \%restoreReq],
[qw(*RestoreReq)]);
$dump->Indent(1);
+ mkpath("$TopDir/pc/$hostDest", 0, 0777)
+ if ( !-d "$TopDir/pc/$hostDest" );
if ( open(REQ, ">$TopDir/pc/$hostDest/$reqFileName") ) {
binmode(REQ);
print(REQ $dump->Dump);