[Box Backup] How to use NotifyScript, SyncAllowScript on Windows

E.W. Peter Jalajas boxbackup@fluffy.co.uk
Tue, 15 Aug 2006 23:04:46 -0700 (PDT)


Thanks, Pierre-Yves and Chris,

I've decided to use cygwin (instead of Perl or the other tools),
because installing that gives me the email tool, but also great command
line tools for grepping and schlepping (sp?) "bbackupquery quit"
output, among lots of other functionality.  It's also quite ubiquitous,
and I trust it.

So, for the How To and google, I installed cygwin, added the email and
ssmtp packages (not sure if I needed ssmtp), then ran ssmtp-config
(again, not sure if I needed this), and email-config.   I then created
C:\Program Files\Box Backup\NotifySysadmin2.sh
shell script file, listing below.

Then in a Windows cmd window, I ran:
C:\>c:\cygwin\bin\sh  "C:\Program Files\Box Backup\NotifySysadmin2.sh"
store-full
(or read-error or other)
and then I get appropriate emails in my other mailbox.

I haven't tested this script being launched by the Box Backup client
yet, but I hope to do so in a few days.  It probably won't work, but
I'll resolve the problems as they come up.

Thanks again,
Pete

#!/bin/sh
#NotifySysadmin2.sh
#Based on original NotifySysadmin.sh from Box Backup 0.10.
#Modified by pjalajas @ tebuco.com 2006-08-16.
#For use on Box Backup clients on Windows with Cygwin.
#Draft, under development.  Please submit improvements.
#Use at your own risk.
#Uses cygwin, with package "email" (and maybe ssmtp) installed.
#After installing package email, run email-config.
#
#I comment out these variables because they are instead set in
email-config (/etc/email/email.conf).
  #SENDFROM="bbclient@xxx.com"
  #SMTPSERVER="mail.www.com"
  #SMTPUSER="user"
  #SMTPPASSWD="123"
  #SENDMAIL="/usr/sbin/sendmail"
  #Setup an underprivileged user account on the mail server for this...
  #SENDMAILOPTIONS="-m login -r $SMTPSERVER -u $SMTPUSER -i $SMTPPASSWD
-n 'Backup SysAdmin' -f  $SENDFROM "
  #I think the box backup account number is all you need, not the
"server" or client host name, but I'm not sure.
  #BBSERVER="rocio"
  #BBCLIENT="bbclient"
SENDMAIL="/usr/bin/email"
SENDTO="bbsysadmin@tebuco.com"
BBACCOUNT="10001001"
MDATE=$(/usr/bin/date)
SUBJECT="BACKUP PROBLEM at Account ${BBACCOUNT} ${MDATE}"

if [ $1 = store-full ]
then
$SENDMAIL -s "${SUBJECT} store-full" $SENDTO <<EOM

The store account for $BBACCOUNT is full.

=============================
FILES ARE NOT BEING BACKED UP
=============================

Please adjust the limits on account $BBACCOUNT.

EOM
elif [ $1 = read-error ]
then
$SENDMAIL -s "${SUBJECT} read-error" $SENDTO <<EOM

Errors occured reading some files or directories for backup on
$BBACCOUNT.

===================================
THESE FILES ARE NOT BEING BACKED UP
===================================

Check the logs on $BBACCOUNT for the files and directories which caused
these errors, and take appropriate action.

Other files are being backed up.

EOM
else
$SENDMAIL -s "${SUBJECT} unknown-problem" $SENDTO <<EOM

The backup daemon on $BBACCOUNT reported an unknown error.

==========================
FILES MAY NOT BE BACKED UP
==========================

Please check the logs on $BBACCOUNT.

EOM
fi

--- Pierre-Yves <ledirach@free.fr> wrote:

> Le mar 15/08/2006 � 23:20, E.W. Peter Jalajas a �crit :
> > Hi all,
> > 
> > Could anyone please help me use NotifyScript, SyncAllowScript on
> > Windows?
> > 
> > For NotifyScript, we need a Windows command line mailer, I think.  
> I
> > found these:
> > http://support.microsoft.com/?kbid=192341  (mailto:)
> > http://www.ss64.com/nt/mapisend.html  (mapisend)
> > 
> > The first (mailto:) will open the message, filled out with the
> info,
> > but won't send it silently.  
> > 
> > The second (mapisend) requires the Back Office/Exchange Resource
> kit
> > which  I'm not able to install at the moment.
> > 
> > Any other suggestions?
> > 
> 
> Hello
> 
> I use bmail or mailsend (google 'em) in various scripts. bmail is
> sortof
> 'self-contained', while mailsend need to know about your external
> SMTP
> server.
> 
> -- 
> Pierre-Yves
> 
> _______________________________________________
> boxbackup mailing list
> boxbackup@fluffy.co.uk
> http://lists.warhead.org.uk/mailman/listinfo/boxbackup
>