Fedora Linux Support Community & Resources Center
Old 27th February 2007, 09:22 AM
herdemo Offline
Registered User
Join Date: Feb 2007
Location: Istanbul, Turkiye
Age: 37
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 :
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
Old 28th February 2007, 08:01 AM
RupertPupkin Offline
Registered User
Join Date: Nov 2006
Location: Detroit
Posts: 6,635
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:

login aaaa
password xxxx

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

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
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
Old 28th February 2007, 10:58 AM
herdemo Offline
Registered User
Join Date: Feb 2007
Location: Istanbul, Turkiye
Age: 37
Posts: 5
thanks all...
Reply With Quote

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 17 13th August 2017 03:14 PM
help required in create a batch file jackal_79 Using Fedora 15 27th February 2008 01:22 AM
batch file manipulator pitat450 Using Fedora 0 1st November 2006 02: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 01:42 AM

Current GMT-time: 08:09 (Friday, 22-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

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