From: bb on
On 2009-11-11 07:13, Lao Ming wrote:
> Since I have all of my lab machines update their OS automatically from
> a cron job, I'm wondering if it's possible to do the same with public
> domain software? Is there some software which I can obtain to enable
> this? I could do it with wget or curl but most of the time, I cannot
> think of a way to detect if the software is a new release. Does
> anyone do this from the shell? Thanks for any thoughts.

I do this on a place where the file names and links changes for every new
version, but my script find them and download them if they are new.

First I run curl on the sparc pages and linux pages and collect the output
in 2 files (sparc , linuxrpm)

Then I try to found all download links, and I'm very worried to put it
here since I made it in csh :-) and that can result in a storm of replies
that it's bad to use, and I agree, but still use it for simple things.

# Get file url's to the software

set sfiles=(` tr '<' '\012' < sparc | grep 'http.*download.*Solaris' |\
sed 's,.*\(http.*download/.*/Solaris.*sparc\.gz\).*,\1,'`)
set lfiles=(`tr '<' '\012' < linuxrpm | grep '/download/.*\.rpm' |\
sed 's,.*\(http.*download/.*\.rpm\).*,\1,'`)

# Download new files
if ($#sfiles == 0 && $#lfiles == 0) then
echo 'no files found, maybe wrong url :-/ '
else
foreach f ($sfiles $lfiles)
wget --timestamping "$f"
end
endif

Well, this is just an example of a thing that has been running on my
machine for years, but it's made just for one site, you must figure
out how to find the download url's of the software you will have.

/bb