raggmopp has asked for the wisdom of the Perl Monks concerning the following question:
The title I'm sure sounds familar but I have been unable to find much to help. So I came up with the following but I'm thinking there is a better way.
What I need to do is copy directories and their files based on the directory name. The directory name is assigned by the Oracle SR module, so an example could be "SR1520931" and it is copied to the directory of ".../SR15xxxxx/SR152xxxx/SR1520xxx/"
Here is the section where I question the efficiency
my $ssh = Net::OpenSSH->new($VHOST); ssh->rsync_get({glob => 1, verbose => 1, times => 1}, ($anon_d/'%4sxxxxx'/'%5sxxxx'/'%6sxxx'/$SRdir/\"$df\"), (substr($SRdir +,0,4),substr($SRdir,0,5),substr($SRdir,0,6)));
Using rsync to pull a copy of the dir&files and put them into the appropriate directory.
This works, but is there a better way?
Many thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: copy files based on name
by CountZero (Bishop) on Feb 27, 2013 at 17:01 UTC | |
by raggmopp (Novice) on Feb 27, 2013 at 18:06 UTC | |
by CountZero (Bishop) on Feb 28, 2013 at 16:47 UTC |