?
Solved

transfer text file from Unix to Windows shared drive

Posted on 2008-11-06
6
Medium Priority
?
1,128 Views
Last Modified: 2013-12-26
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
0
Comment
Question by:rajsan1
6 Comments
 
LVL 1

Accepted Solution

by:
lk-data earned 1500 total points
ID: 22899409
Can you use SSH ?

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

Normaly you can use SSH on unix.
0
 
LVL 39

Expert Comment

by:Adam314
ID: 22899583

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
 

Author Comment

by:rajsan1
ID: 22900519
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 39

Expert Comment

by:Adam314
ID: 22906767
From a prompt as root:
    cpan Net::FTP
OR
    perl -MCPAN -e 'install Net::FTP'
0
 
LVL 62

Expert Comment

by:gheist
ID: 22929490
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question