Solved

How to copy files from linux to windows with a shell script

Posted on 2011-09-07
6
357 Views
Last Modified: 2013-11-13
*** Please Help .. Very Important

Would like to know how to transfer a file using shell script from windows to unix box

and later execute the script which would transfer the file by picking it up from my windows machine locally and later place it at the destination which is a unix box

please let me know the script and also how to execute the steps

if any links available please post.
0
Comment
Question by:XxtremePro
6 Comments
 
LVL 5

Expert Comment

by:KGNickl
ID: 36496743
You can do it multiple ways.

1) If the unix server is setup with Samba just mount the drive to your windows server then use a batch file with normaly copy commands. If not it might be worth looking into settting Samba up.
2) If your unix box has FTP or SCP setup you can just write a script that connects and copies files over.
3) NFS (http://support.microsoft.com/kb/324060) - Not familiar with this.
0
 
LVL 5

Expert Comment

by:KGNickl
ID: 36496782
if you go the Samba Route....

Batch file instructions for copy/paste:
http://www.ehow.com/how_6830153_copy-paste-batch-file.html

NOTE: You would just copy from the location and then paste to whatever drive/location you mapped the Samba share to.

For the samba setup I would good for instructions for the specific version of Unix you have. Also, google on how to map the share to your Windows machine. Should be easy enough.
0
 

Author Comment

by:XxtremePro
ID: 36497271
Please help me with the script to copy CSV file from windows machine to a unix machine

I have the credentials and the location to place the file at

I am doing using WINSCP and it gives a ^M after every record
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Accepted Solution

by:
AlexPace earned 500 total points
ID: 36497971
Windows text files use CRLF for end of line.  Some FTP clients will fix this for you automatically if it detects that the remote server is returning UNIX-style directory listings and you send a text file in ASCII mode instead of Binary.  If WinSCP doesn't do it then try Robo-FTP... it has better scripting capabilities anyway.
0
 
LVL 9

Expert Comment

by:parparov
ID: 36499489
You can use the pscp command line utility from the putty package:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
0
 

Author Closing Comment

by:XxtremePro
ID: 36587194
Thanks for the Comment Expert!!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
find a node in VST 2 63
wordappend challenge 8 143
iframe detection of parent window scale 20 59
How to obtain Administrator permission when you are the Administrator 6 58
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

930 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now