RayRay459 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to copy a log file in a specific directory on a number of machines in my domain to one central machine to hold all of the copies. It is a Win32 environment. I did a super search and didn't find anything specific to win32 so i have a few questions: 1) I need to read in a list of machines in...i assume i should use a while loop to get every machine's copy of the log file but do i need to use the "\\" to connect to the machine's file system? If so, how can i do that? 2) should i use the File::Copy module. Does that apply to NT? Any help to get me started would be much appreciated. A novice monk. ~Ray~
  • Comment on copying files from a number of remotes to another central machine

Replies are listed 'Best First'.
Re: copying files from a number of remotes to another central machine
by HyperZonk (Friar) on Jul 20, 2001 at 03:46 UTC
    A good starting place for dealing with resources on a win32 network is the module (drum roll, please ...) Win32::NetResources available on CPAN.
Re: copying files from a number of remotes to another central machine
by adamsj (Hermit) on Jul 19, 2001 at 21:48 UTC
    I tend to build from scratch, so I'd say look at Net::FTP to get the files from the machines. Script your session so that it names the incoming files in a manner that represents where they came from.

    Loop through the machine names any way you want--there's probably a way to use map.

    Update: You can tell I think in UNIX, can't you?

    adamsj

    They laughed at Joan of Arc, but she went right ahead and built it. --Gracie Allen

      I'm not sure if using Net:FTP will be the best idea for connecting to my machines. They are production boxes. and i am also a novice in perl. :) Ray
        I think you could distribute a script to all the remotes that ftp'ed the file back to the central server. Of course, you might be able to schedule a simple batch script to do that-- as opposed to having to put perl on all those machines.

        Or assuming you have mounted the central server as a drive on all the remotes, instead of FTPing the file you just copy it over. Making sure to perhaps change the filename so there aren't collisions, or giving each remote its own subdir on your server.