Perl: Sending file from UNIX server to Windows server
I'm trying to write a Perl script where a file from a UNIX server box connects to a Windows server box and copies that file into the Window box.
The main problem I have right now is that whenever I try to connect to the Windows box, the connection is refused.
The error message that always pops up is:
cannot connect to host name: Net::FTP: connect: Connection refused at transfer.pl line 16.
My code is essentially this:
Any thoughts as to why this would happen (ex. firewall issues)?
For the host name, I use the domain name (both the short and full versions) and the actual IP address, but all of them have the same error message.
Many thanks!
First choose a protocol, ssh2 (scp2) is a great first choice, but you seem to be using ftp. There is the mount flavored family like NFS and SAMBA, file only tools like ftp, and file/command tools like rcp/rsh, scp/ssh/sftp, ssh2/scp2/sftp2. There are services, like http, you could create to facilitate this. There are often perl extensions to allow you to do these inside perl.
Get the protocol working from the command line before getting into code with it.
1. Turn the "Debug" Param on:
2. Set it to "2" if that shows more output ( it does with Net::SSH::Perl ) e.g.
3. Check if you can login to the win machine from the unix machine on the command line
4. if not telnet to port 21 ( the FTP command channel )
5. if not see if anything is getting through to the windows box.
( if you don't have nmap installed install it with apt-get install nmap or yum install nmap. )
Hi All
I need to transfer a file from a UNIX server to a windows server.
I saw that it is possible to do this using scp command by looking at the forum listed below:
... (2 Replies)
I have two servers linux and windows and i want to compare files which are in unix server that to windows server and find out which are missing
that means i have 50 files with 6000 records in each file on linux server and i want to verify weather these 50 files are present in windows server... (5 Replies)
I need to transfer files from a Windows server to the Unix server and have to run some shell script on it to get the required output.
Is it possible to transfer files from Windows server to unix server through any shell script?
If so can you please help me with the details.
Thanks in... (8 Replies)
hi guys,
i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not
and again i have to reverse sftp the files from unix to windows server.....
regards,
Vasa Saikumar. (13 Replies)
I have a Perl script that worked fine before moving it to justhost.com. It was on a Windows/Apache server. Just host is using UNIX. Other Perl scripts on other sites that were also moved work fine so I know Perl is functioning.
The script is called cwrmail.pl and is located in my cgi-bin.
When I... (9 Replies)
Can anybody please help me on how to code for the below requirement:
I need to write a shell script (on different unix server) to copy files from multiple folders (ex. BRN-000001) from one windows server (\\boldls-mwe-dev4)to a different windows server(\\rrwin-ewhd04.ecomad.int). This shell... (4 Replies)
Hi,
I am trying to write some test code for bigger project where my perl script will send file over to server. This is the current SERVER and CLIENT code I have so far. When I type "hi" from client I get hello back from server and like wise I send send command I get respond back the problem... (1 Reply)
Hi,
Below is the script which ftps the file from unix server and putting in a different directory(but on unix server)
How can i ftp the files from unix server and to place in a secure location on windows server? what changes needs to be done to the below script?
How can this be... (1 Reply)
I have a .sh script which was running fine on all the UNIX Servers (AIX, SunSolaris). The script requires two mandatory parameters and many optional parameters. Now at a different client place who are on a Windows Server, when I try to execute the script through MKS Toolkit, there are couple of... (5 Replies)
Hi,
My local server is :/usr/abcd/
Remote server is :/Usr/host/test/
I want to send files from local unix directory(All files starting with O_999) to
remote host unix directory.
Can any body give me the Unix Shell script to do this.
One more doubt: Shall we need to change the file... (1 Reply)