Fedora Linux Support Community & Resources Center
  #1  
Old 27th February 2007, 08:22 AM
herdemo Offline
Registered User
 
Join Date: Feb 2007
Location: Istanbul, Turkiye
Age: 34
Posts: 5
FTP batch file

Hi all,

I have a problem, I want to write a batch file for file transfer via ftp.
When i using windows, or dos i use this commad:
open :192.168.111.55
user: aaaa
pass: xxxx

then i write this command, "ftp -s:myfile" i connect the server.
How can i use this commands for linux...
thanks all.
Reply With Quote
  #2  
Old 28th February 2007, 07:01 AM
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 5,629
In linux you can put the remote machine name, user name and password in a file called .netrc in your home directory. So for example, your ${HOME}/.netrc file would contain the following lines:

machine 192.168.111.55
login aaaa
password xxxx


Then give the file the correct permissions: chmod 600 ~/.netrc
You would then run the command: ftp 192.168.111.55

If you are looking to automate the whole ftp procedure so that it requires no user interaction, you can use the "expect" package that comes with Fedora. In fact, expect can even create the script that automates it for you. In your case you could just run this command:
autoexpect ftp 192.168.111.55
Then go through the steps you would manually go through to ftp your files over. Autoexpect will watch your session and create a script called script.exp when you quit from ftp. Running that script will go through all the things you did when you ftp'd your files.
Reply With Quote
  #3  
Old 28th February 2007, 09:58 AM
herdemo Offline
Registered User
 
Join Date: Feb 2007
Location: Istanbul, Turkiye
Age: 34
Posts: 5
thanks all...
Reply With Quote
Reply

Tags
batch, file, ftp

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch File Rename xamox Using Fedora 15 23rd July 2014 03:25 AM
help required in create a batch file jackal_79 Using Fedora 15 27th February 2008 12:22 AM
batch file manipulator pitat450 Using Fedora 0 1st November 2006 01:51 PM
Help porting a windows batch file JohnF Programming & Packaging 1 29th September 2005 06:44 PM
linux equivalent of a windows batch file marion Using Fedora 13 12th February 2005 12:42 AM


Current GMT-time: 06:17 (Saturday, 30-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat