You would have to be careful that the format output by date exactly matches the one in ls.

I'm not sure what you are trying to do here.

Are you running by hand a script to check if cron ran? Then you still have to run a command every day.

Maybe you run the check in cron. But then how do you know whether the check ran?

The smart thing to do is write the first script so it is completely reliable.

If this is part of a bigger system, then maybe you have a lot of different stuff that you want to be sure ran. So you probably want one morning check that looks at all the other things that should have run.

When I did this stuff, I just used to have a script that emailed me a bunch of log files timed for when I got in the office. I had a paper checklist weekly that i ticked off the logs on, or a cross if they failed or were missing.

You have not asked for the date to be displayed.
?
The output of date +%d is maybe 23 if you ran it yesterday.
?
So the day digit is inserted into the awk fragment like:
?
awk '($7 == 23) {print $8}'
?
So if the day is 23, awk prints field 8, which is the the time 04:28.
?
You need to list all the fields you want to see in the print statement. Or just print $0 and get them all.
?

If you want the exit status of the job, why don't you just send the exit status of your routine to a file like /tmp/`basenam` with the exit status and the date of the run. Then just check this file every day.

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.