Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: hanscees on January 28, 2004, 10:03:21 PM

Title: howto download an entire ftp directory for DAT files
Post by: hanscees on January 28, 2004, 10:03:21 PM
Hi,
sorry this is not directly e-smith related, but I do have to use this on my e-smith server, if that counts for anything.

I am trying to make a script to automatically download anti-virus databases so my clients can ftp them of the server.

I am trying to do this with mcaffee.

The problem is that the directory (ftp.nai.com/CommonUpdater) has subdirectories, and I have to download all the content to get it working. The subdirs change over time.....

Now I know how to do "mget *" and to use .netrc. But how can I ftp the complete subdirs with again layers of subdirs in them automatically?

Any tips are very welcome. Or should I install and use  a commandline ftp client. If so, any ideas?

greetings

Hans-Cees
Title: Re: howto download an entire ftp directory for DAT files
Post by: tape on January 29, 2004, 06:06:16 PM
Quote from: "hanscees"
Hi,
sorry this is not directly e-smith related, but I do have to use this on my e-smith server, if that counts for anything.

I am trying to make a script to automatically download anti-virus databases so my clients can ftp them of the server.

I am trying to do this with mcaffee.

The problem is that the directory (ftp.nai.com/CommonUpdater) has subdirectories, and I have to download all the content to get it working. The subdirs change over time.....

Now I know how to do "mget *" and to use .netrc. But how can I ftp the complete subdirs with again layers of subdirs in them automatically?

Any tips are very welcome. Or should I install and use  a commandline ftp client. If so, any ideas?

greetings

Hans-Cees


man rsync
and/or
man wget
should help. More wget, on rsync there is an rsync server needed at the "other" side, wich i wouldn´t expect.

hth
Anton
Title: mirror an ftp-site for local antivirus updates
Post by: hanscees on February 02, 2004, 02:30:25 PM
Thanks!

I did it this way:

cd /home/e-smith/files/ibays/nai/files/
#wget
#--wait=2 is wait 2 seconds between each file
#m is mirror
#-nH is no host directories.
wget -m --wait=2 -nH  ftp://ftp.nai.com/CommonUpdater/

I run this from cron every 2 hours or so. Less in the night. I points the symantec virusscan to it and they update.