wget options

  • Thread starter Thread starter Helge Haensel
  • Start date Start date
H

Helge Haensel

Hallo!

I am using wget as follows:
C:\Utilities\wget\wget.exe -nv
"http://updates.f-prot.com/cgi-bin/get_randomly?fp-def"
This command downloads the requested file(s) always and does not overwrite
the existing one(s). So an error comes up.
What I want is: Download only when a new file is available and overwrite
the existing one.
I (am german) have a problem with the correct interpretation of the
various options of wget. Is there a solution? I hope so.
Thanks!

Vy 73! Helge
 
Helge Haensel said:
Hallo!

I am using wget as follows:
C:\Utilities\wget\wget.exe -nv
"http://updates.f-prot.com/cgi-bin/get_randomly?fp-def"
This command downloads the requested file(s) always and does not overwrite
the existing one(s). So an error comes up.
What I want is: Download only when a new file is available and overwrite
the existing one.
I (am german) have a problem with the correct interpretation of the
various options of wget. Is there a solution? I hope so.
Thanks!

Vy 73! Helge

I'm not sure if wget has an option to check if the file exists on
the remote site. However, you could resolve the problem
locally like so:
@echo off
set Target=D:\Downloaded
set Name1=get_randomly?fp-def
set Name2=get_randomly@fp-def
set Name3=WebFile

if not exist "%Target%" md "%Target%"
cd /d "%Target%"
if exist "%Name2%" del "%Name2%
wget\wget -nv "http://updates.f-prot.com/cgi-bin/%Name1%"
if exist "%Name2%" copy /y "%Name2%" "%Name3%"

The batch file will attempt to download the file "%Name1%. If successful
then it will copy it to "%Name3%".

Note the difference between %Name1% and %Name2%. The
distinction is necessary because you cannot have files with
question marks in their names.
 
I'm not sure if wget has an option to check if the file exists on
the remote site. However, you could resolve the problem
locally like so:
@echo off
set Target=D:\Downloaded
set Name1=get_randomly?fp-def
set Name2=get_randomly@fp-def
set Name3=WebFile

if not exist "%Target%" md "%Target%"
cd /d "%Target%"
if exist "%Name2%" del "%Name2%
wget\wget -nv "http://updates.f-prot.com/cgi-bin/%Name1%"
if exist "%Name2%" copy /y "%Name2%" "%Name3%"

The batch file will attempt to download the file "%Name1%. If successful
then it will copy it to "%Name3%".

Note the difference between %Name1% and %Name2%. The
distinction is necessary because you cannot have files with
question marks in their names.

Thank you, I shall try that.
Helge
 
Not if it is existing (normaly it does) but if it is updated (new date).
Helge
Really sorry, something went wrong.
Using the commandline:
C:\Utilities\wget\wget.exe -nv
"http://updates.f-prot.com/cgi-bin/get_randomly?fp-def"
actually correctly downloads fp.def.zip but
C:\Utilities\wget\wget.exe -nv
"http://updates.f-prot.com/cgi-bin/get_randomly?fp-def/fp-def.zip"
doesn't work correctly!
fp.def.zip is a file with virus definitions of about 6 Mb in size and I
want to
dl'd it only when an updated (date changed) version is available.
I understand the trick with the copy command.
Thanks.
Helge
 
Not if it is existing (normaly it does) but if it is updated (new date).
Helge
Really sorry, something went wrong.
Using the commandline:
C:\Utilities\wget\wget.exe -nv
"http://updates.f-prot.com/cgi-bin/get_randomly?fp-def"
actually correctly downloads fp.def.zip but
C:\Utilities\wget\wget.exe -nv
"http://updates.f-prot.com/cgi-bin/get_randomly?fp-def/fp-def.zip"
doesn't work correctly!
fp.def.zip is a file with virus definitions of about 6 Mb in size and I
want to
dl'd it only when an updated (date changed) version is available.
I understand the trick with the copy command.
Thanks.
Helge

===========================

My virus scanner determins by itself when a new pattern
definition file is available. Seeing that fprot is a fine product,
I'd be very surprised if it did not also have such a function.
If it does and if you wish to distribute it to several machines
then you should monitor the pattern file stored on your hard
disk, and spread it around after it has been updated. This is
far simpler than attempting to poll the Frisk site at regular
intervals.

The fprot FAQs would be a good place to check the auto-
update feature of fprot.
 
Back
Top