[Box Backup-dev] Re: [Box Backup] ChrisMerge_1828

James O'Gorman boxbackup-dev at fluffy.co.uk
Thu Sep 13 12:25:24 BST 2007


--jL2BoiuKMElzg3CS
Content-Type: multipart/mixed; boundary="DIOMP1UsTsWJauNi"
Content-Disposition: inline


--DIOMP1UsTsWJauNi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

[Redirecting to -dev]

On Wed, Sep 12, 2007 at 08:30:58PM +0100, James O'Gorman wrote:
> On Wed, Sep 12, 2007 at 07:54:03PM +0100, Chris Wilson wrote:
> >  A submission of a NotifyScript that either uses Perl or cmd.exe would =
be=20
> >  appreciated :-)
>=20
> I can probably hack an existing VBscript I use at work (uses CDO to send
> mai). I'm guessing some people might prefer that as it's Windows-native
> from at least Win98+.

OK, attached is a script that should hopefully do the same as the
current shell script.

The only difference is that if the SMTP service is not installed on the
box, you need to uncomment the four lines near the bottom and set the
smtp server.

I was about to submit it as an enhancement ticket, and notice that there
seems to be some ticket spam now. Looking at the permissions,
non-registered users are able to create tickets. Should I change this?

James

--DIOMP1UsTsWJauNi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="NotifySysAdmin.vbs"
Content-Transfer-Encoding: quoted-printable

Dim from
Dim sendto
Dim subjtmpl
Dim subject
Dim body

=66rom =3D "boxbackup@%%server%%"
sendto =3D "admin at example.com"
subjtmpl =3D "BACKUP PROBLEM on host %%server%%"

Set args =3D WScript.Arguments

If args(0) =3D "store-full" Then
  subject =3D subjtmpl & " (store full)"
  body =3D "The store account for %%server% is full." & vbCrLf & vbCrLf & _
         "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D" & vbCrLf & _
         "FILES ARE NOT BEING BACKED UP" & vbCrLf & _
         "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D" & vbCrLf & vbCrLf & _
         "Please adjust the limits on account %%account%% on server %%serve=
r%%." _
         & vbCrLf
  SendMail from,sendto,subject,body
ElseIf args(0) =3D "read-error" Then
  subject =3D subjtmpl & " (read errors)"
  body =3D "Errors occured reading some files or directories for backup on =
%%server%%." _
         & vbCrLf & vbCrLf & _
         "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D" & vbCrLf & _
         "THESE FILES ARE NOT BEING BACKED UP" & vbCrLf & _
         "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D" & vbCrLf & vbCrLf & _
         "Check the logs on starbug.netinertia.co.uk for the files and dire=
ctories which caused" & _
         "these errors, and take appropraite action." & vbCrLf & vbCrLf & _
         "Other files are being backed up." & vbCrLf
  SendMail from,sendto,subject,body
Else
  subject =3D subjtmpl & " (unknown)"
  body =3D "The store account for %%server% is full." & vbCrLf & vbCrLf & _
         "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D" & vbCrLf & _
         "FILES MAY NOT BE BACKED UP" & vbCrLf & _
         "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D" & vbCrLf & vbCrLf & _
         "Please check the logs on %%server%%." & vbCrLf
  SendMail from,sendto,subject,body
End If


Sub SendMail(from,sendto,subject,body)
  Set objEmail =3D CreateObject("CDO.Message")
  Dim cdoschema
  cdoschema =3D "http://schemas.microsoft.com/cdo/configuration/"
  With objEmail
    .From =3D from
    .To =3D sendto
    .Subject =3D subject
    .TextBody =3D body
' If the backup server does not have the SMTP service installed, uncomment
' the following lines and set the smtpserver property to a relay server.
'    .Configuration.Fields.Item(cdoschema & "sendusing") =3D 2
'    .Configuration.Fields.Item(cdoschema & "smtpserver") =3D "smtp.example=
=2Ecom"
'    .Configuration.Fields.Item(cdoschema & "smtpserverport") =3D 25
'    .Configuration.Fields.Update
  End With
  objEmail.Send
End Sub
--DIOMP1UsTsWJauNi--

--jL2BoiuKMElzg3CS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iQEVAwUBRukeJP8Z3wLA10m9AQIy0wf/S/SpFmBV90MNWUsloKHQ5BM4RLy5kwvE
lcjgGIVoZyB2nnH70q4oYSfxdU6V8nGpjrj2YBR8NeDmOLfoGxrhm/BG+X3cIlLr
qO4tGZoSbD0MLVbmhAkr0nKJu4mxqN6D4+awrSf87MNV0c5zxi8frlg4A/yqkg7O
ZYKR3fltr6kHBKF2dNwMsggEMbuP6Ayss+VCKm5UDtZjo6kKt9D9wttnWfKDrkjo
naqUDH3N7Y/xK7C5e0EYGl56KjeOYyZD+Y0t5K0euDvXKg5F4S4KO27AdvnASORM
Vz2ADVIVMxoBfDKy5nT5DbTb2LiMGBlWWkRfdElfud8HZOUNiQ12uw==
=SVxV
-----END PGP SIGNATURE-----

--jL2BoiuKMElzg3CS--



More information about the Boxbackup-dev mailing list