Batch file help - or help monitoring a scheduled task
#1
Scooby Regular
Thread Starter
Batch file help - or help monitoring a scheduled task
Looking for some clever people out there who can ehlp me with this one :
I have a scheduled task that runs every five minutes, copying a file from the a server to a users PC. This is a network downtime procedure so the info is still available even if there is no network. As such, if the task fails.. the first i'll hear of it is if the network fails and the users can;t retrieve the info locally.
I'm trying to monitor that the file is copying. I'm trying to incorporate some sort of time check into a batch file, and if the file is more than 10 minutes old, then send a mail.
I've made a start (below) .. but all this does is emails me if the file doesn;t exist. Which it allways does as it overwrites every 5 minutes.
Any other suggestions on how i might do this are welcome!!
Cheers
Avi
I have a scheduled task that runs every five minutes, copying a file from the a server to a users PC. This is a network downtime procedure so the info is still available even if there is no network. As such, if the task fails.. the first i'll hear of it is if the network fails and the users can;t retrieve the info locally.
I'm trying to monitor that the file is copying. I'm trying to incorporate some sort of time check into a batch file, and if the file is more than 10 minutes old, then send a mail.
I've made a start (below) .. but all this does is emails me if the file doesn;t exist. Which it allways does as it overwrites every 5 minutes.
Any other suggestions on how i might do this are welcome!!
Cheers
Avi
Code:
IF NOT EXIST "C:\file.htm" GOTO NOEXIST if exist "C:\file.htm" GOTO END :NOEXIST bmail -s srexchange5 -t me@email.com -f them@email.com -h -a "Subject FILE DOES NOT EXIST" -b "Body of message" :END
#2
Moderator
iTrader: (5)
Join Date: Nov 2001
Location: Not all those who wander are lost
Posts: 17,863
Received 0 Likes
on
0 Posts
Couldn't tell you exactly, but a combination of ATTRIB and XCOPY should get the job done. You may want to copy the file to another temporary location based on whether its modifed or not then email if it doesn't exist or delete the temp copy.
Thread
Thread Starter
Forum
Replies
Last Post
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM