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/here
I 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?