Hi All,
I am planning to implement batch script for if any file is sating from 15 min then i need to soot an email. Please suggest me on this.
Thanks,
JP.
Find files 15 min old in a dir and send mail
Moderator: DosItHelp
Re: Find files 15 min old in a dir and send mail
Hi redro,
first you have to solve the "mail to" problem
your own code
How to handle this, depends extremly on your mail mechanism.
It could be easier to use a tool like BLAT.exe, we use it for automaticaly publish new versions of our software
and call it like
Second:
You have to solve your problem to find the 15min files, but you should read "Batch ffmpeg auto convert"http://www.dostips.com/forum/viewtopic.php?f=3&t=1020
It handles nearly the same problem.
jeb
first you have to solve the "mail to" problem
your own code
@echo off & setlocal
:: set the temp file location
set tempmail=%temp%\tempmail.%random%.txt
:: echo the basic headers to the temp file
echo To: "Scripting Test" ^<praveen.pullela@sirvisetti.com^>, ^<prakash.redrouthu@sirvisetti.com^> > %tempmail%
echo From: "Me" ^<support@sirvisetti.com^> >> %tempmail%
echo Subject: CVG ESB Process DOWN >> %tempmail%
:: echo the blank line that separates the header from the body text
echo.>>%tempmail%
:: echo the body text to the temp file
echo ESB DOWN ON 9099 port PLS check>> %tempmail%
echo GOOD DAY.>> %tempmail%
:: move the temp file to the mail pickup directory
:: adjust this location for your system
move %tempmail% c:\inetpub\mailroot\pickup
set tempmail=
endlocal
How to handle this, depends extremly on your mail mechanism.
It could be easier to use a tool like BLAT.exe, we use it for automaticaly publish new versions of our software
and call it like
Code: Select all
blat -q -subject "%subject%" -f %MAILFROM% -to %MAILTO% -server %MAILHOST% -u %MAILUSERNAME% -pw %MAILPASSWORD% -bodyF %SOURCE%
Second:
You have to solve your problem to find the 15min files, but you should read "Batch ffmpeg auto convert"http://www.dostips.com/forum/viewtopic.php?f=3&t=1020
It handles nearly the same problem.
jeb
Re: Find files 15 min old in a dir and send mail
Hi Jeb,
I have just added call.sendmail.bat in else condition and succeed in sending mail. Thanks for your assistence.
Thanks,
JP
I have just added call.sendmail.bat in else condition and succeed in sending mail. Thanks for your assistence.
Thanks,
JP
Re: Find files 15 min old in a dir and send mail
HI Jeb,
I have successfully sending mail from XP environment but i am unable to send from Win 2003 with my above script. Any idea on it.
Thanks,
JP.
I have successfully sending mail from XP environment but i am unable to send from Win 2003 with my above script. Any idea on it.
Thanks,
JP.
Re: Find files 15 min old in a dir and send mail
Hi,
I suppose the sendmail fails, but better you post the output here.
jeb
I suppose the sendmail fails, but better you post the output here.
jeb