transfer text file from Unix to Windows shared drive

Hi
Can any one help me in writing script to transfer textfile from unix box to windows shared drive?

I don't have Samba, Only method I can you is ftp or Perl Script.
Can you help me in writing Perl script or ftp scritp.
Windows servername =USA1234DR
Unix Servername = UXDVE12

My file is in
$home/usr> ls
test.txt

I want to copy to my windows shared drive \\USA1234DR\workingdir

Thanks
Raj
rajsan1Asked:
Who is Participating?
 
lk-dataCommented:
Can you use SSH ?

The use this software here: http://winscp.net

Normaly you can use SSH on unix.
0
 
Adam314Commented:

use Net::FTP;
 
$ftp = Net::FTP->new("USA1234DR.your.company", Debug => 0)
  or die "Cannot connect: $@";
 
$ftp->login("username",'password')
  or die "Cannot login ", $ftp->message;
 
$ftp->cwd("/workingdir")
  or die "Cannot change working directory ", $ftp->message;
 
$ftp->put("your.file")
  or die "get failed ", $ftp->message;
 
$ftp->quit;

Open in new window

0
 
rajsan1Author Commented:
I am getting error when I compile this code
Can't locate Net/FTP.pm in @INC (@INC contains: /opt/per15/lib/5.00502/PA-RISC1.1
Can you help me..

OR Is it possible in ftp script
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Adam314Commented:
From a prompt as root:
    cpan Net::FTP
OR
    perl -MCPAN -e 'install Net::FTP'
0
 
gheistCommented:
You need SAMBA installed on UNIX client machine. Then you can use smbclient to transfer file to windows share.
Alternatives are NFS server included with MS-SFU, or using least common denominator - FTP

http://hpux.connect.org.uk/hppd/hpux/Networking/Misc/samba-3.0.10/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.