Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Batch file help - or help monitoring a scheduled task

Thread Tools
 
Search this Thread
 
Old 21 February 2008, 11:48 AM
  #1  
Avi
Scooby Regular
Thread Starter
 
Avi's Avatar
 
Join Date: Apr 2001
Location: Manchester
Posts: 5,084
Likes: 0
Received 0 Likes on 0 Posts
Default 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

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
Old 21 February 2008, 02:11 PM
  #2  
DJ Dunk
Moderator
Support Scoobynet!
iTrader: (5)
 
DJ Dunk's Avatar
 
Join Date: Nov 2001
Location: Not all those who wander are lost
Posts: 17,863
Received 0 Likes on 0 Posts
Default

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.
Old 21 February 2008, 10:19 PM
  #3  
Hanley
Scooby Regular
 
Hanley's Avatar
 
Join Date: May 2002
Location: Liverpool
Posts: 3,229
Likes: 0
Received 0 Likes on 0 Posts
Default

Yeah I'd use Robocopy to move the file to a temporary location, use the MAXAGE switch to set the age limit on the file i.e. 10 mins

Old 22 February 2008, 06:09 PM
  #4  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Default

what o/s?
Old 22 February 2008, 06:18 PM
  #5  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Default

could try starting with this Batch files - Use DATE and TIME to prefix strings
Old 23 February 2008, 03:59 PM
  #6  
Avi
Scooby Regular
Thread Starter
 
Avi's Avatar
 
Join Date: Apr 2001
Location: Manchester
Posts: 5,084
Likes: 0
Received 0 Likes on 0 Posts
Default

OS is : Windows 2003

Cheers guys i'll have another bash at it on Monday
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM
T.K
General Technical
10
02 October 2015 11:35 AM
yabbadoo4
ScoobyNet General
11
30 September 2015 10:33 PM
Nick_Cat
Computer & Technology Related
2
26 September 2015 08:00 AM



Quick Reply: Batch file help - or help monitoring a scheduled task



All times are GMT +1. The time now is 09:06 PM.