1.

Solve : can i get a bat file to alert me if it fails??

Answer»

can i get a bat file to email me if it fails?

also, is there and easy way to schedule a bat file to run every night at a certain time?

Im trying to setup Jenkins, scheduler, here, but, its not going well. The commands im feeding it work in the cmd window, but, they dont work in Jenkins.


so im thinking, ok nevermind jenkins, why not just create a bat file.
the only prob with that is how to get it to kick off, and how to get it to alert users to success or failure of the build.

kind regards,
brian .Quote

can i get a bat file to email me if it fails?


Yes and No ... If it fails it can not report failure, so you need a 2nd PROCESS which could be a different batch file that performs a checkup on the batch that is to be monitored for failure and performs the e-mail through 3rd party software that allows for e-mail sent from COMMAND line.

I made a C++ program that checked a Routine1_log.txt file for the date. The batch process started at 12:15am and so if it completed successfully, (got to complete the entire instruction set of the batch file), at the end of this batch file I had a echo. %date%>Routine1_log.txt to pass the date to this log file. The C++ program I wrote would run at 4am and test to MAKE sure that todays date matched that of the Routine1_log.txt file. If it was a match then no e-mail alert. If there was a mismatch, then I would be sent an e-mail. I then was able to check my e-mail first thing in the morning and see what processes failed if any did. It was a very rare occurrance to have a batch malfunction or fail to complete, but it happened 2 times in 5 years.

Not to SIDETRACK, but I ended up creating a monitoring system that would give me a phone call and play prerecorded messages to myself as to the problems so I knew where the problem was and was able to get to the site and already know what I was up against before getting there. In addition to programs I wrote in C++, I used a cool software tool called Alert Ping Pro and bought a license of it. http://www.downloadsource.net/1844/AlertPingPro/ Figured I'd share this in case you need additional monitoring such as to make sure network attached devices are LIVE as well as I also had 4 other locations bridged to the central hub and I could tell when a site went offline from the central hub location.
Quote
also, is there and easy way to schedule a bat file to run every night at a certain time?
Yes IF Windows OS using Scheduled Task Manager to trigger execution of batch etc at a specific time.

Quote
Im trying to setup Jenkins, scheduler, here, but, its not going well. The commands im feeding it work in the cmd window, but, they dont work in Jenkins.

I have never used Jenkins, but I am assuming that your dealing with a common problem where you are trying to pass keystrokes to Jenkins that is running in a different window than that of the batch file. Easiest way to make this work is to use a keyboard/mouse macro creator such as jitbit and compile the routine to an exe form which can then be started from the batch file and copy/paste info or enter info into specific fields etc.Dave I know this a month or two later, but I just wanna say thanks for going to the trouble of writing your reply.
interesting reading, ill have to look more into each section.

regards,
redd . Hey, no problem ... usually when there is no response, we all figure that the request for help was resolved. Its all good!And not to worry about the time...it's nice enough you had the courtesy to return with a reply.


Discussion

No Comment Found