Sorry , I missed that part
The 'trick' to that is to use the find command.
That is the manual for find
See if you can work out how to 'find' files no older than 14 days
You then need to feed that list into the loop
There are a number of ways to do that.
One is to put the output of find into an array (you will need bash instead of sh )
Another (not recommended)
Code:
for Zip in $(find $ROOT_DIR <your 14 day 'rules'> -name "*.zip");do
stat ....
done
Falls over if spaces in file path/name
The best solution would be a while read loop, using heredocs
Code:
while read Zip;do
stat ...
done < <(find ....) > $logfile
apologies for 'gaps', I hate using software keyboards on phones
All will be covered in unSpawn's links
The wooledge ones are especially good, as they point out bad habits found on the web (including some in tldp ! )
If you get stuck, show us what you have, we can then help you out
Edit;
While 'testing' leave off the > $log....
So output is on screen, no need to mess about with cat to see results
Edit2:
One week or two?