FTP on Demand

You know it: If you want to load down a big file from a distant server (overseas perhaps), the maximum transfer rate can not be reached. If you are using ISDN it is extreme. But you have no ISDN Port to spend the telecom union your money, and you use the best operating system in the world :-) People who can access the Internet via a university and send some Unix commands to it, can do something.


But how? The trick is to load the file not directly, but let the provider do it for you. After some time you can load the desired file from the provider without wasting time - the connection to your provider most times is so fast that you reach the maximum transfer rate. Unix knows the command nohup which allows a command execution without being logged in - this is the trick. You can log in at your provider and type in:
  provider:# nohup ftp -i &
  provider:# exit
  connection closed by foreign host.
  root:# _
This takes only a few seconds, only one tariff unit is lost for a good purpose.

But you have to do some prework, because ftp is an interactive program, which needs a lot of information for its work (e.g. what to load). You can tell ftp how to be less interactive by giving the option "-i". But you need to tell ftp the information what to do, and this happens if you create a file .netrc at your provider. (The option "-n" tells ftp to ignore this file.)

If you want, for example, load down the Linux kernel 2.0.7 from the LEO.ORG server (more than 5 Megabytes!) the file .netrc could look like:

  login anonymous
  password <my@email.address>
  macdef init
    lcd /usr/src
    cd /pub/comp/os/linux/Linus/v2.0
    get linux-2.0.7.tar.gz
So cou could create an entry for each server you want to connect. This file must be stored in your directory at your provider before you call the nohup ftp command. One hour later you can load down directly your kernel. Great, isn't it?


Ok now. Now we want to do it automatically. Of course we need the cron again, which will do the data transfer in the cheap night hours.

... But this is not finished yet. Please wait...

I had no time to do more research - but some people wrote me hints.

Uwe Bonnes <> wrote:


you should point at "ncftp" for ftp-on-demand. I open the program using
"nohup ncftp", open the server I need, choose the file using the "tab" 
expansion and start the download. A ctrl-Z and "bg" move the download into
background and myself in the commandline to stop the connect.

Gunnar Larisch <> wrote:

Some nice scripts:

getme <Server> <Dir> <File>
cronftp must be started using cron. You can fetch your file the next day.

fetfrom also may be useful.


# Parameters: Server Path File(s)

echo Server : $1
echo Dir    : $2
echo "File   : $3"
echo Jobfile: $FTPFILE

touch $FTPFILE

echo lcd ~/tmp/ftpjobs >>$FTPFILE
echo open $1 >>$FTPFILE
echo user anonymous >>$FTPFILE
echo bin >>$FTPFILE
echo "cd $2" >>$FTPFILE
echo "mget $3" >>$FTPFILE
echo close >>$FTPFILE

echo Hole $2 von $1...
echo ftp -i $1 >>~/tmp/ftpjob
echo bin >>~/TMP/ftpjob
echo cd $2 >>~/tmp/ftpjob

mkdir ~/tmp/ftpjobs
echo Using $FTPFILE... as $NEWFTPFILE
nohup ftp -in <$NEWFTPFILE &

Ciao Gunnar

Siggi Thoma <> schrieb:

Did you hear about FTPMAIL? Perhaps this matches the purpose and is a bit

Just write an e-mail to 
subject HELP

This server at the Uni allows to fetch any file from all over the world 
to Stuttgart. It mails this file in uuencoded format to you. So only the
providers transfer data rate is the limiting factor.

You find detailled descriptions in the net. Search for FTPMAIL at Yahoo or 


Copyright © (GPL V 2) 1996 Bernhard Hailer
Last modification: 24-Feb-97 BeH