LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-31-2008, 05:44 PM   #1
myint45
LQ Newbie
 
Registered: Aug 2006
Posts: 10

Rep: Reputation: 0
Smile FTP files from Linux to Windows


I'm trying to write a script to copy files with .config within the file name and transfer it to a windows AD share.

Any ideas??

I'm thinking FTP. I don't know much about FTP to put it into a script.

1) How can I setup FTP from Linux to Windows?
2) Is there a way to connect and do multiple files?
3) Can I use $variable to do a loop and then pass it to FTP?

thanks a bunch.

L.M
 
Old 01-31-2008, 06:00 PM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Quote:
1) How can I setup FTP from Linux to Windows?
The way you describe it, you need a FTP server on the windows system (preferably sftp). However, for simple file transfers, you will probably find scp a better bet.

Quote:
2) Is there a way to connect and do multiple files?
man ftp
But you really need an ftp or ssh tutorial. ftp uses mput to batch-transfer files. scp uses similar syntax to regular cp.

Quote:
3) Can I use $variable to do a loop and then pass it to FTP?
In a bash scrip - yes.

However - usually you would prefer the server to be a linux box, and rig the windows machines to connect regularly. But you know your setup.
 
Old 01-31-2008, 06:05 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Quote:
Originally Posted by myint45 View Post
I'm trying to write a script to copy files with .config within the file name and transfer it to a windows AD share.

Any ideas??

I'm thinking FTP. I don't know much about FTP to put it into a script.

1) How can I setup FTP from Linux to Windows?
2) Is there a way to connect and do multiple files?
3) Can I use $variable to do a loop and then pass it to FTP?

thanks a bunch.

L.M
first off, you're better off setting up a real share on the windows machine then mounting that share on the linux machine. This eliminates the need to ftp. The share stuff is done with samba. There's probably a nice GUI in your distro if you're not familiar with mounting a samba share. If not, you'll need to read some docs on samba.
Once that's done, it's simply a matter of copying the files to the windows machine, i.e. "copy *.config /mnt/windows_share/some_dir"

If you want/need to use ftp, a good, scriptable ftp client is ncftp. It has something called ncftpput which is made for scripting - does an ftp upload, passwords and all, as one command, so you could easily do something like (in tcsh):

Code:
foreach f (*.config)
 ncfftpput backup_server remote_dir $f
... that will do multiple files.

This, of course, assumes you have an ftp server setup on Windows.

Last edited by BrianK; 01-31-2008 at 06:06 PM.
 
  


Reply

Tags
ftp, linux, windows



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP from Linux to Windows envisage Linux - Networking 3 01-31-2008 04:23 PM
linux to windows ( ftp)!! justsimran Linux - General 3 04-02-2007 07:58 PM
converting a doc/ppt Windows files in html files under linux env agrosu Programming 7 02-23-2006 03:07 PM
Backed up Windows Files on Linux; Can't Recover them to Windows MadFunk Linux - Software 6 08-16-2003 08:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration