I'm trying to use GNU wget in a bash shell script to automate the download of virus identities to my linux webserver which will then in turn be picked up by my windows clients. I am using wget timestamping to only download the file if it has changed on the vendors site, I also need to make a copy of this file into a standard name that all my windows clients can use.
At the moment I have;
if `wget -N http://www.sophos.com/downloads/ide/380_ides.exe`; then
cp -f 380_ides.exe ides.exe
echo "IDEs were updated."
echo "IDEs do not need to be updated."
However in the instance where wget does not download the 380_ides.exe file because it is no newer that the one it downloaded last time it still evaluates the "if" and remakes the ides.exe file. My windows clients are also using wget and so they are always thinking the file ides.exe is new and as such are always hammering my webserver for updates they don't need.
I cannot find any documentation on wget return codes on the GNU site. Does anyone know how I can make this work?