Download by ftp anonymous via crontab

Download by ftp anonymous via crontab

Post by Nguyen-Dai Qu » Thu, 17 Dec 1998 04:00:00



Hi,
Howto download a file via ftp (anonymous) by using crontab ?
I try in my cron file:
0 2 25 12 * /home/users/quy/mydownload
With my script "mydownload".
I don't know howto connect to ftp server by "anonymous"
automatically ?

In the interactive mode, I have to do :
#ftp ftp.xxxx.com
.... anonymous
.... myaddress..
.... cd ....
.... get file
..... bye for exit

Howto put all in a file and execute automatically ?

_______________________________________________________
 Nguyen-Dai Quy
 LTAS - Mcanique de la Rupture, ULG.
 Rue Ernest Solvay 21, Bat C3, B 4000, Lige, Belgique
 Tl:+32-4-366.92.41        Fax:+32-4-366.93.11
 http://isis.ltas.ulg.ac.be/dang/who/quy.html
_______________________________________________________

 
 
 

Download by ftp anonymous via crontab

Post by Juergen Hein » Thu, 17 Dec 1998 04:00:00



>Hi,
>Howto download a file via ftp (anonymous) by using crontab ?
>I try in my cron file:
>0 2 25 12 * /home/users/quy/mydownload
>With my script "mydownload".
>I don't know howto connect to ftp server by "anonymous"
>automatically ?

You can use $HOME/.netrc for instance ...
machine  ftp.ptf.org
login    anonymous

macdef   init
bin
cd /
get everything
andsoon
andsoon

... and the trailing lines are really there. Very handy, but
you can use wget for example too (might be faster if a file
is* around on some proxy already).

I guess that is a FAQ anyway, isn't it 8)

Cheers,
Juergen

--
\ Real name     : Jrgen Heinzl                 \       no flames      /

  \ Phone Private : +44 181-332 0750              \                  /

 
 
 

Download by ftp anonymous via crontab

Post by mc.. » Fri, 18 Dec 1998 04:00:00


: Hi,
: Howto download a file via ftp (anonymous) by using crontab ?
: I try in my cron file:
: 0 2 25 12 * /home/users/quy/mydownload
: With my script "mydownload".
: I don't know howto connect to ftp server by "anonymous"
: automatically ?

: Howto put all in a file and execute automatically ?

If you have Perl with the lib-net bundle you can use
lwp-download ftp://ftp.host.com/pub/path/file

In general you can edit a ~/.netrc file according to the man page
man .netrc  
or
man netrc
-Mike

--
Michael Cope: Harvey Mudd College '00; Armand Hammer UWC '96

 
 
 

Download by ftp anonymous via crontab

Post by bmar.. » Fri, 18 Dec 1998 04:00:00



   >Howto download a file via ftp (anonymous) by using crontab ?
   >I try in my cron file:
   >0 2 25 12 * /home/users/quy/mydownload
   >With my script "mydownload".
   >I don't know howto connect to ftp server by "anonymous"
   >automatically ?
   >In the interactive mode, I have to do :
   >#ftp ftp.xxxx.com
   >..... anonymous
   >..... myaddress..
   >..... cd ....
   >..... get file
   >...... bye for exit
   >Howto put all in a file and execute automatically ?
ftp ftp.xxx.com <<BYE
user anonymous
pass myaddress
cd /somewhere
get file
BYE

Net-Tamer V 1.08X - Test Drive

 
 
 

Download by ftp anonymous via crontab

Post by Roman Diese » Fri, 18 Dec 1998 04:00:00




> >Hi,
> >Howto download a file via ftp (anonymous) by using crontab ?
> >I try in my cron file:
> >0 2 25 12 * /home/users/quy/mydownload
> >With my script "mydownload".
> >I don't know howto connect to ftp server by "anonymous"
> >automatically ?

        (1) Prepare your ftp session file:
$
$ cat >ftpsession

prompt
binary
get filename
quit
^D
$      
$       (2) Prepare your crontab script:
$
$ cat >mydownload
#!/usr/bin/sh

/usr/bin/ftp -n host <ftpsession
^D
$
$chmod +x mydownload
$
$       (3) Run it before placing it in crontab!
$
--
Trachtet zuerst nach dem Reich Gottes...