Guide - Using Server Edition Backup Scripts

The Backup Scripts feature is an awesome one and can be very useful for situations when a task needs to be run before, after, or in the event of a failure of a backup. Below I will include some information about this feature, how it can be used, etc. I hope this proves to be helpful.

What can be executed through the Backup Scripts feature?

  • Any type of file that can be executed by an operating system

What types of scripts/languages can be used for the Backup Scripts feature?

  • If the operating system can execute the file type, then it can be used as a Backup Script.
  • Example: on a Windows server, you could easily use .bat, .vbs, .ps1, or even an .exe

How should the file be referenced in the Jungle Disk Configuration Manager?

  • Absolute paths must be used
  • This Example Fails: junglediskbackupscript.ps1
  • This Example Works: C:\Users\username\Documents\junglediskbackupscript.ps1

As for being able to specify arguments to an executable, I do not believe this is possible, but will have to test it out, Judging by what I am seeing in the code, this is not supported, but you could always have a script that executes an .exe and can pass in arguments.

Here's an example script I wrote up for another customer. This vbs script will fire off an email when the Backup Vault Database reaches a certain size, but will only fire the email when the size is exceeded, not before.


Dim maxFileSize
 Dim OutputStr
 Dim sendFrom
 Dim sendTo
 Dim sendSMTP
 Dim sendUser
 Dim sendPass
 Dim sendPort
 Dim useSSL

 '    Change these variables to fit your location
 maxFileSize=14                        'Maximum allowed DB file size in GB
 sendFrom="""Jungle Disk Backup Script Notifier"" //YOUREMAIL@HERE//"    'The FROM name and email that displays on the email (extra quotes are needed)
 sendTo="//RECIPIENTEMAIL@HERE//"        'The email address to send emails to 

 sendSMTP="//SERVER NAME HERE//"            'SMTP server to send emails
 sendUser="//SMTP USERNAME HERE//"                    'Username for SMTP server to send emails
 sendPass="//SMTP USER PASSWORD HERE//"                    'Password for SMTP server to send emails
 sendPort=465                            'Port number for SMTP server to send emails
 useSSL=true                        'Does the sending SMTP server use SSL?  true or false

 Set WshShell = Wscript.CreateObject("WScript.Shell")
 Set Envi = WshShell.Environment ("Process")
 Set objFSO = createobject("Scripting.FileSystemObject")
 Set shApp = CreateObject("Shell.application")

 'Check to see if the local\app data directory exists
 If objFSO.FolderExists("C:\PATH\\TO\\FOLDER\\HERE") Then
     Set FolderPath = objFSO.GetFolder("C:\PATH\\TO\\FOLDER\\HERE")

 'For each file that ends in "db", check it's file size
     For Each File in FolderPath.Files
         If objFSO.GetExtensionName(File)="db" Then
 '1843 is the size of the file in MB
             If cint((File.size / 1024) / 1024) > maxFileSize Then
                 OutputStr = OutputStr & & " : " & cint((File.Size / 1024) / 1024) & "MB" & vbCrLf
             End If
         End If
 'If there was output, email the information
     If OutputStr <> "" Then
         Set WshNetwork = WScript.CreateObject("WScript.Network")

         Const cdoBasic = 1 'basic (clear-text) authentication

         Set objMessage = CreateObject("CDO.Message")
         objMessage.Subject = "The backup database files on " & WshNetwork.ComputerName & " are too large."
         objMessage.From = sendFrom
         objMessage.To = sendTo
         objMessage.TextBody = OutputStr

 'This section provides the configuration information for the remote SMTP server.
         With objMessage.Configuration.Fields
             .Item("") = 2
             .Item("") = sendSMTP
 'Type of authentication, NONE, Basic (Base64 encoded), NTLM
             .Item("") = cdoBasic

             .Item("") = sendUser
             .Item("") = sendPass

             .Item("") = sendPort

             .Item("") = useSSL

             .Item("") = 60

         End With

         On Error Resume Next
     End If
     wscript.echo "Error: Folder path does not exist."
 End If
Was this article helpful?
0 out of 0 found this helpful
Powered by Zendesk