Script to Email Confirmation if Latest File Contains Specific String



Hello,

We are running SAP and Oracle on Win2000 and Win2003 environments.
As I am not experienced in Windows scripting, I would greatly
appreciate it if somebody could point me in the right direction for a
script which does the following:

We have a directory which contains backup log files for any number of
systems (Depending on the day of week, etc..). The logs are all named
'*.afd' or '*.ald'. If a backup was successful, one of the final lines
in the log file contains the string '100.00' (As in 100%
of files were backed up).

The script is to check for any '*.afd' or '*.ald*' file created in
the previous 24 hours in any subdirectory under a specific drive (Say
'D').

If that file contains the string '100.00', the script should send
an email to a hardcoded address with the name and path of the
log file, as well as a confirmation such as 'Backup likely successful'.
(For example, 'D:\DEV\abclog.afd Backup likely sccessful').

If the log file does not contain the string '100.00', the script
should send an email to a hardcoded address with the name
and path of the log file, as well as a message such as 'Backup
likely failed'.(For example, 'D:\Other\QUA\deflog.afd Backup likely
failed'.).

I realize that this script has many parts (Searching a directory
tree, checking for a specific string in a file, emailing, etc..)
so even ideas on how to do parts of it would be useful.

If possible, I would like to do this using default Windows commands,
without using Perl or other languages.


Thanks in Advance,
BASIS Consultant

.



Relevant Pages

  • how can i get the current user which starts the store eventsink???
    ... i have built a script with the EventSink Wizard from the Exchange SDK ... Sub EventLog(EventName As String, ByVal bstrURLItem As String, ... *Dim objSession As MAPI.Session ... LogFile 'Set the path of the log file to be in the Windows System ...
    (microsoft.public.exchange.development)
  • [OT] mondoarchive via cron - how do you know if it completed correctly?
    ... I've been using mondoarchive for awhile now for interactive backup to CD's. ... We put in a tape drive and I set it up to backup to tape every night by ... writing a very simple script and putting it in /etc/cron.daily (the script ... The problem is that I get a 6k log file each morning ...
    (RedHat)
  • Re: Scheduling a script
    ... I do have a log file backup scheduled along with my regular backup. ... It can schedule jobs and run code. ... > Can I add though that this script is probably not a good idea. ...
    (comp.databases.ms-sqlserver)
  • Re: loop does not count...
    ... > I am trying to learn Python by doing something useful; write a script ... > not) and only the last string actually is counted....why is that? ... The lines you're reading from your test file all end ... finding them in the log file. ...
    (comp.lang.python)
  • Re: mksysb script
    ... I have tried the script and it works fine regarding mksysb. ... >> Also should have record in a log file about backup and status of backup. ... >> This last line in Cron should report error if occurs. ...
    (comp.unix.misc)