We have a couple of backup programs which create a log file which we need to monitor for size. On one machine it creates a log file to a set directory, but the log files are within a folder which is created with the date and time the backup ran - so c:\backup\2014-06-04 20.00.07\logfile.txt. I need to monitor the size of the latest file in the latest folder and report if it is lower than 1k as this would indicate the backup has failed.

On another machine it creates the file into the same folder but appends the date to the end of the file - c:\backup\backup20140604.bak

Both machines should have a file that was created each night and the so the file would just need to be checked for once a day

Any suggestions on how to do this?