• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help to Copy a File from Unix to Windows

 
Sam Saha
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a script which basically capture the necessary lines from the stack of a source file and dump them into a destination file in the same Unix server. I want to add script in my existing script so that instead of same server I can dump the output into Windows server(like C:\) or somehow I can copy that file from Unix to Windows. I am new in Unix scripting. I would appreciate if someone can help me writing the script.

Here is my script:



 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To transfer a file from one computer to another - regardless of what OS's are involved, you need either a file-transfer program or a file server.

Popular file-transfer programs include FTP servers, HTTP servers, rcp, scp and rsync. Just for starters.

A file server can be set up using Windows File sharing on the Windows side or on the Linux side, you can use Samba or NFS (although NFS requires you to install an NFS client on the Windows machine).

Pick one and we can help you use it.
 
Sam Saha
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I want to use FTP. Please guide me how can I use ftp in my script to trasfer a file from Unix to Windows.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, you need to set up an FTP server in the Windows machine. Any version of Windows that contains IIS has an FTP server also available (this includes Windows Server and Professional).

Once that is set up, look at the man pages on your Linux box for the ftp command options for the command to place into your script.
 
Pradeep Kumar
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To transfer files between Unix and Windows you can install WinSCP tool which is a free tool. Once installed the files can be copied from and to Unix and Windows machine.

Regards,
Pradeep
http://www.unixonthego.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic