I have a script that writes some information to a text file of system health every few minutes with a date stamp in the filename, ie pi-2-black_status_161018_0000.txt.
I'm writing another script to search that directory and do something if it does not see any files created in the last 60 minutes.
I'm failing on 2 issues. First one is I can't seem to use wildcards when searching. In the example below it will search for the existence of 'pi-2-black_status_161018_0000.txt' which works fine. However if I change the search to 'pi-2-black_status_??????_????.txt' it doe's not work.
if [ -f "$SEARCHFILE" ]
echo "Not found"
Secondly, how do I add an, 'if file older than 60min' into the search, I thought I could place -mmin +60, however that does not appear to work.
Many thanks for any help.