Article 563SC wget/curl file that has been uploaded within the last 2-3 days?

wget/curl file that has been uploaded within the last 2-3 days?

by
orangepeel190
from LinuxQuestions.org on (#563SC)
Hi all,

I am seeking thought what line I could add to a download script. I am seeking to only download $file that was uploaded/modified within the last 2-3 days?

The reason is that every week, the same filename to $file so when my script seeks out this file, it has no idea if the file is the latest version (modified/uploaded within the last few days) or if it is the previous/old version of the file.

I am thinking of using something like:

find . -mtime -2 for two days prior

Then there is ls -ltr but I am struggling to work out what to grep/pipe as output to ensure that it only downloads the latest file (within the last 2-3 days_ when the script runs

the download command is similar to:

Code: echo "Getting file from Webserver"
/usr/bin/curl -SkLo $file http://some.webite/hereI am having difficulties is working out what commands put in place to verify that the file that is about to be downloaded has been uploaded in the past 2-3 days. I am assuming this "magic line" would go after the curl line .....curl -SkLo $file http://some.webite/here | (HERE)

I am reading something about curl --time-cond or -z. Will that check the date details of the file on the server (to be potentially downloaded) or simply compare against an existing file?

Am I on the right path?latest?d=yIl2AUoC8zA latest?i=8NwkjzbKOkE:oWWIH2kjGDs:F7zBnMy latest?i=8NwkjzbKOkE:oWWIH2kjGDs:V_sGLiP latest?d=qj6IDK7rITs latest?i=8NwkjzbKOkE:oWWIH2kjGDs:gIN9vFw8NwkjzbKOkE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments