3dbc has asked for the wisdom of the Perl Monks concerning the following question:
sub copyDat { my $file = basename($_[0]); my $path = dirname($_[0]); #$path .= "\\"; #trailing slash was needed for xcopy, but xcopy no +t as reliable as robocopy for full automation with better logging. print "\n File: $file \n\n"; print "\n Dirname: $path \n\n"; chomp $_[1]; my $map = $_[1]; my $map = $1 if($map=~/(.*)\\$/); #trailing slash not needed for r +obocopy, but not sure if it's as picky, but it definately needs a map +ping and not a unc path to work. print "\nnet use $map && ROBOCOPY \"$path\" \"$map\" $file /B && n +et use $map /delete\n\n"; #I'll add some more flags to robocopy to j +azz it up but want to get this sequence to work first. open TASK, "net use $map && ROBOCOPY \"$path\" \"$map\" $file /B & +& net use $map /delete 2>&1|" or die "cannot pushd $_[1]"; while (<TASK>) { print; #chomp; #chop; #return $_; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl robocopy to temp mapped drive.
by NetWallah (Canon) on Oct 04, 2018 at 23:07 UTC | |
by 3dbc (Monk) on Oct 11, 2018 at 19:52 UTC | |
by 3dbc (Monk) on Oct 11, 2018 at 15:48 UTC | |
by poj (Abbot) on Oct 11, 2018 at 17:45 UTC | |
by 3dbc (Monk) on Oct 11, 2018 at 17:53 UTC | |
|
Re: perl robocopy to temp mapped drive.
by Veltro (Hermit) on Oct 05, 2018 at 13:26 UTC | |
by 3dbc (Monk) on Oct 11, 2018 at 15:59 UTC | |
by 3dbc (Monk) on Oct 12, 2018 at 15:32 UTC |