File::Copy from NT to Unix using UNC 
Author Message
 File::Copy from NT to Unix using UNC

Can I use File::Copy with a UNC to copy files from the local NT server
(where the script is running) to a Unix server?

I have successfully written a Perl script (running on NT) using
File::Copy to distribute updated sets of files from the local NT
development server to multiple NT production servers.  I am using UNC
naming for the destinations so that I am not dependant on drive letter
mappings.  I would like to also copy the files to Unix servers with
this same script.  In the script, I have one array that is a list of
the files to be distributed and another array that is a list of the
destination servers.  I want to be able to mix NT and Unix servers in
the list.  I have tried using destination UNC syntax for the Unix
systems like //servername/user/file or //servername/~user/file or
//ipaddress/user/file but the copy command always returns the error
"No such file or directory" even though they do exist.  I am only
marginally familiar with Unix.

If the final answer is NO, what is the best way for a Perl script to
copy a file from an NT system to a Unix system?  I hope it's not rcp,
which I'm using now and have been told to stop using.



Tue, 22 Mar 2005 23:36:54 GMT  
 File::Copy from NT to Unix using UNC

Quote:

> Can I use File::Copy with a UNC to copy files from the local NT server
> (where the script is running) to a Unix server?

Yes, if you've set up samba (or equivalent) on the unix server.

Quote:
> I have successfully written a Perl script (running on NT) using
> File::Copy to distribute updated sets of files from the local NT
> development server to multiple NT production servers.  I am using UNC
> naming for the destinations so that I am not dependant on drive letter
> mappings.  I would like to also copy the files to Unix servers with
> this same script.  In the script, I have one array that is a list of
> the files to be distributed and another array that is a list of the
> destination servers.  I want to be able to mix NT and Unix servers in
> the list.  I have tried using destination UNC syntax for the Unix
> systems like //servername/user/file or //servername/~user/file or
> //ipaddress/user/file but the copy command always returns the error
> "No such file or directory" even though they do exist.  I am only
> marginally familiar with Unix.

> If the final answer is NO, what is the best way for a Perl script to
> copy a file from an NT system to a Unix system?  I hope it's not rcp,
> which I'm using now and have been told to stop using.

rcp is marginally more secure than UNCs, so I'm not sure what your
sysadmins (I'm assuming) are complaining about.

Another way is to use Net::FTP (most unixes need little work, if any,
to get their ftp daemon running).  However, this requires embedding a
password in your script, or somewhere that your script can get at it.

Yet another way is to find some sort of NFS client for Windows.  I'm
assuming they exist - I've only used NFS clients on Unix and OS/2.
File::Copy will work transparently here.

Perhaps you could write a CGI script to run on the Unix machine that
would receive files, and you could use one of the LWP modules to send
your files with appropriate placement information.  This assumes you
have a web server running on the unix machine.

Finally, if all else fails, you may be able to write your own "special"
rcp server that you might be able to get away with.  Write a perl
daemon on the unix machine that listens to requests, and can receive
files.  Obviously the most work, and it isn't likely to be as good or
secure as rcp, but because it won't be rcp, your sysadmins might not
complain.

As you can see, with tcp/ip, there are many, many ways of skinning this
cat, depending on your skill, time, and requirements.

--
To reply, please remove the obvious spam filter



Wed, 23 Mar 2005 03:32:58 GMT  
 File::Copy from NT to Unix using UNC
NFS access from windows can be done by something like the Maestro suite from
Humming Bird, works pretty well.

Nigel


Quote:

> > Can I use File::Copy with a UNC to copy files from the local NT server
> > (where the script is running) to a Unix server?

> Yes, if you've set up samba (or equivalent) on the unix server.

> > I have successfully written a Perl script (running on NT) using
> > File::Copy to distribute updated sets of files from the local NT
> > development server to multiple NT production servers.  I am using UNC
> > naming for the destinations so that I am not dependant on drive letter
> > mappings.  I would like to also copy the files to Unix servers with
> > this same script.  In the script, I have one array that is a list of
> > the files to be distributed and another array that is a list of the
> > destination servers.  I want to be able to mix NT and Unix servers in
> > the list.  I have tried using destination UNC syntax for the Unix
> > systems like //servername/user/file or //servername/~user/file or
> > //ipaddress/user/file but the copy command always returns the error
> > "No such file or directory" even though they do exist.  I am only
> > marginally familiar with Unix.

> > If the final answer is NO, what is the best way for a Perl script to
> > copy a file from an NT system to a Unix system?  I hope it's not rcp,
> > which I'm using now and have been told to stop using.

> rcp is marginally more secure than UNCs, so I'm not sure what your
> sysadmins (I'm assuming) are complaining about.

> Another way is to use Net::FTP (most unixes need little work, if any,
> to get their ftp daemon running).  However, this requires embedding a
> password in your script, or somewhere that your script can get at it.

> Yet another way is to find some sort of NFS client for Windows.  I'm
> assuming they exist - I've only used NFS clients on Unix and OS/2.
> File::Copy will work transparently here.

> Perhaps you could write a CGI script to run on the Unix machine that
> would receive files, and you could use one of the LWP modules to send
> your files with appropriate placement information.  This assumes you
> have a web server running on the unix machine.

> Finally, if all else fails, you may be able to write your own "special"
> rcp server that you might be able to get away with.  Write a perl
> daemon on the unix machine that listens to requests, and can receive
> files.  Obviously the most work, and it isn't likely to be as good or
> secure as rcp, but because it won't be rcp, your sysadmins might not
> complain.

> As you can see, with tcp/ip, there are many, many ways of skinning this
> cat, depending on your skill, time, and requirements.

> --
> To reply, please remove the obvious spam filter



Sun, 20 Mar 2005 09:26:03 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. mkdir on UNC Names (Windows NT) (File::Copy)

2. unwanted UNIX file permissions after using File::Copy::syscopy

3. Using File::Copy and Sockets to copy public files from http addresses

4. Filecopy using UNC on NT

5. Warning using copy from File::Copy

6. UNC drive\path\file for NT Cgi/Perl script

7. Copying to a NT-server using C$

8. Copying to a NT-server using C$

9. File copying from Mac To Unix

10. File::Copy, copying files problem.

11. NT mkdir and UNC Paths

12. UNC-Path under windows NT ?

 

 
Powered by phpBB® Forum Software