I need to create a script that checks to see if any of the .TIF files in the directory are older than 10 minutes and if so send out an e-mail to alert me. The script I would like to timeout and only run every 10 minutes. heres an extreme rough draft
:start
set date=%date:~4,2%-%date:~7,2%-%date:~10,4%
setlocal EnableDelayedExpansion
SET filename="\\molinevm\NG Batch\FAX\"
if [ FOR %%f IN (%filename%) DO SET filedatetime=%%~tf
IF (%currentDate%-%filedatetime%) < 600 goto :noProblem // this checks to see if all files are within the "OK" time range and skips down if they are ok.
echo "Faxes have been in molinevm for longer than 10 minutes." | mail -s "Faxes Not Working" "my email"
:noProblem
timeout /t 600 /nobreak
goto :start`