0

I am looking for a way to create a scheduled task to automatically download the "DAT Package For Use with McAfee ePO" offered here. The link text on that page ("DAT Package For Use with McAfee ePO") always stays the same, but it points to a different .zip file daily, so the link target differs.

Is there a way to do this?

3 Answers 3

2

Something along these lines (broken into separate lines for readability):

wget --execute=robots=off --recursive --level 1 --span-hosts \
--accept=.zip --no-directories --domains=download.nai.com \
http://www.mcafee.com/apps/downloads/security-updates/security-updates.aspx

If you're always asked to accept before being allowed to download, you'll probably have to save/load cookies. Look at the --[save|load]-cookies option to wget.

0

You might want to try using Selenium, the browser automator. Or, if you're on a Mac, Fake might be an easier solution.

Beyond that, a curl piped to an awk piped back to xargs curl might be your best bet, but that is going to be pretty messy.

0

An improvement on jáquer's answer:

wget --recursive --no-parent --level=1 --no-directories --reject html \
--accept-regex='avvepo.*dat.zip' --timestamping \
'http://download.nai.com/products/DatFiles/4.x/NAI/'

McAfee keeps the last three DAT archives in that directory, so the above command will download all three, but only if the files in the current directory are older than what's available (that's what --timestamping does). You'll have to do some additional scripting if you want to do something with only the latest file. But you should keep the latest three in your download directory to prevent redownloading all three files every day.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .