943,867 Members | Top Members by Rank

Ad:
May 27th, 2008
0

Transfter files from linux to windows

Expand Post »
Hi,


I am new to this forum, I want to write a script which will transfer files from linux to windows,

on my Linux server ftp is disabled,
Reputation Points: 10
Solved Threads: 0
Newbie Poster
born4unix is offline Offline
2 posts
since May 2008
May 27th, 2008
0

Re: Transfter files from linux to windows

A script? Why not just use Samba?
Reputation Points: 118
Solved Threads: 30
Posting Shark
linux is offline Offline
931 posts
since Aug 2006
May 28th, 2008
0

Re: Transfter files from linux to windows

Do you mean you want to transfer files from like hdb# (Linux /) to hdb# (/mnt/windows) or to a different machine entirely?
Reputation Points: 10
Solved Threads: 2
Junior Poster in Training
BillBrown is offline Offline
60 posts
since Dec 2006
May 28th, 2008
0

Re: Transfter files from linux to windows

Well judging from his saying that his ftp server is disabled, I'd say two different machines.
Reputation Points: 118
Solved Threads: 30
Posting Shark
linux is offline Offline
931 posts
since Aug 2006
May 29th, 2008
0

Re: Transfter files from linux to windows

I use scp which is a secure copy over SSH. First get SSH installed and running on the Linux machine.
On the Windows machine install WinSCP
once thats connected it's almost as simple as drag and drop to transfer files using a a nice split screen for files.

But a script would be a little more challenging...off hand I know of a way with FTP but then you'd have to set up the Windows machine as a FTP server. I think we need more details on what you are trying to do, like does the Windows machine have any open shares or anything that we can use?
Last edited by icaruslnx; May 29th, 2008 at 12:03 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
icaruslnx is offline Offline
4 posts
since May 2008
Jun 1st, 2008
0

Re: Transfter files from linux to windows

Click to Expand / Collapse  Quote originally posted by born4unix ...
Hi,


I am new to this forum, I want to write a script which will transfer files from linux to windows,

on my Linux server ftp is disabled,

On your Linux machine create a script that will use smbclient to transfer your file which might look something like this:

======================= CAUTION : UNTESTED!!! =====================
I just wrote this on the fly...

====================== USE AT YOUR OWN RISK!!! ====================

#!/bin/bash
#
# cp2win
# Transfer a file to a windows machine using smbclient
# Script by hardwyrd (c) 2008
#
# Syntax:
# cp2win switch host-folder file remote-username remote-password
#
# Example:
# cp2win nologin \\\\myserver\myshare myfile.txt
# cp2win \\\\myserver\myshare myfile.txt myuser mypassword
#
# switch:
# nologin - turns on using login credential
#
# host-folder: must be in the format \\\\machine\folder

case $1 in
nologin )
smbclient $2 -c "put $3"
;;

* )
smbclient $1 -U $3%$4 -c "put $2"
;;

esac
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hardwyrd is offline Offline
8 posts
since Feb 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in IT Professionals' Lounge Forum Timeline: confused, need help!
Next Thread in IT Professionals' Lounge Forum Timeline: URGENT help with registration/username/password





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC