in reply to Re^4: Archive::Tar from somewhere outside my runtime directory
in thread Archive::Tar from somewhere outside my runtime directory
The log shows...$vsvroot = $config{$ServerX . "ROOT"}; chdir($vsvroot); MsgLog ("d", "vsvroot = $vsvroot"); MsgLog ("d", cwd()); foreach $vsvxdb (<cntl/*>) { MsgLog ("d", "Add $vsvxdb to tarfile\n"); if (! $tar->add_files($vsvxdb)) { MsgLog ("e", "Failed to add original $vsvxdb to backup + archive. Quitting.") } }
vsvroot = "C:\LRSROOT\vsvxroot"
C:/LRSROOT/vpsxroot
Add cntl/ckpt.dat to tarfile
Which lines above correspond to the three MsgLog function calls in the sample code. Note that the vsvroot variable (I left the $ off in the log message) uses backslashes and points to the vsVxroot folder but the print of cwd() shows the vPsxroot folder - same parent, different subfolders. The perl code is called from and app who's root is vPsxroot. I've tried this with a simple test script and it definitely still calls tar from the working directory which is not changed by chdir(). I'm very confused!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Archive::Tar from somewhere outside my runtime directory
by murrayn (Sexton) on Jan 25, 2012 at 03:13 UTC |