logo del sito - virgix
Virgilio.org
Blat, Abakt & some batch

search suggestions

 

How to send a complete backup with a click


When a customer calls for a problem, often there is need to recreate it on the development machine: in order to make it it is necessary have a backup of his data, but if your applications isworking inside an Intranet, and the network administrations dosn't allow remote access, you are in trouble...! To obtain the data via email becomes painful or impossible sometimes, unless than you have constructed one micro emergency procedure…. All at no cost,becuouse the necessary software is free and open source!

You will need to download the following software:

Blat - program in order to send mail from command line - http://www.blat.net/

Abakt - A Backup Tool - http://www.xs4all.nl/~edienske/

Seven zip – www.sourceforge.net

Or, you can use also the classic winzip instead of seve zip, but winzip is not a free tool

First of all we install Blat, copying the executable 'Blat.exe' in "\ WINNT \ SYSTEM32" or wherever your system folder is, and then issue the following command:
“Blat - install smtp.yoursite.tld youruserid@yoursite.tld”
here the creenshot of the installation on my machine - obviously personalized with my data:

blat installation - click for enlarged image

 

We then install Abakt - in this case execute a plain installation ruotine - and launch the executable to create the task of backup: in the examplewe want to get the file eCommerce.mdb, and therefore we select the folder where the archives are, excluding the files that that do not interest:
Abakt creating the task: choosing files to backup - click for enlarged image

 

The image shows that the ways to exclude files from your backup are really complete.

It is then necessary to select the type of action and the method of recording: having to send the file by email, we choose to compress it with winzip.

 

We choose the destination folder:

 

And we specify the way to operate:

 

We could also verify archives..




We test the task in order to verify that il works, and to get the file to test Blat:


All OK! We got the zipped archive:


 

Then we launch the batch: here is the output:


We check the arrival of the mail:

Blat: we got mail! - click for enlarged image

Blat: ok, we got the file! - click for enlarged image

 

Naw we can create a shortcut on the desktop of the customer, and at the moment of the need it will be easy to receive the copy of arches of our procedures, or any other file - i.e. some logfiles!


And here you find the text of the batch that executes the task of Abakt and then sends it via mail as attach using Blat (you can download the batch, see link at the bottom of the page:

@rem == ///////////////////////////////////////////////////////////////////////////
@rem == ----------------------------------------------------------- ///////////
@rem == This file sends a binary file attached to an email message ///////////
@rem == Each comment has been translated in italian, so each comment ///////////
@rem == will have two lines, the first in english, the second the ///////////
@rem == italian translation ///////////
@rem == .......................................................... ///////////
@rem == Questo file invia un file binario come allegato di una mail ///////////
@rem == per ogni commento la prima riga è in inglese, la sconda riga ///////////
@rem == contiene la traduzione italiana ///////////
@rem == ----------------------------------------------------------- ///////////
@rem == by Virgix - http://www.virgilio.org - summer 2006/Estate 2006 ///////////
@rem == ----------------------------------------------------------- ///////////
@rem == ///////////////////////////////////////////////////////////////////////////

@rem == this part must be edited to fit your paths
@rem == questa parte del file va modificata per adattarla ai vostri percorsi

@rem == Path to Blat executable
@rem == Percorso dell'eseguibile di Blat
set BLAT="C:\Programmi\Blat250\full\blat.exe"

@rem == Path to Abakt executable
@rem == Percorso dell'eseguibile di Abakt
set ABAKT="C:\Programmi\Abakt\Abakt.exe"

@rem == Path to the saved profile to be used from Abakt
@rem == Percorso del profilo salvato da usare con Abakt
set PROFILE=C:\Programmi\Abakt\BackupDBEcommerce

@rem == Path to the file to be sent as mail attach
@rem == Percorso al file chevolete spedire come allegato
set FILE_TO_SEND=C:\TEMP\backup\BackupDBEcommerce.zip

@rem == Your email address
@rem == Il vostro indirizzo di posta
set EMAIL=dev@virgilio.org

@rem == SMPT provider
@rem == il vostro server SMPT
set PROVIDER=out.alice.it

@rem == Body of mail
@rem == it testo della mail
set BODY=Ecco il DB!

@rem == ||||| no need to edit beyond this line! ||||||||||||||||||||||||||||||||
@rem == ||||| fine area da personalizzare! ||||||||||||||||||||||||||||||||

@rem == Prepare blat:
@rem == Preparo blat:
%BLAT% -install %PROVIDER% %EMAIL%

@rem == Call Abakt:
@rem == Eseguo il profili di Abakt:
%ABAKT% -b -x -l -m "%PROFILE%.abp"

goto result%ERRORLEVEL%
:result0
@rem OK (0x00)
%BLAT% -attach %FILE_TO_SEND% -s "%PROFILE%.abp Ok" -body " %BODY% " -to %EMAIL%
@goto end
:result2
@rem OK+WARNING (0x02)
%BLAT% %FILE_TO_SEND% -s "%PROFILE% Ok + Warnings" -to %EMAIL%
@goto end
:result1
@rem ERROR (0x01)
:result3
@rem ERROR+WARNING (0x03)
%BLAT% %FILE_TO_SEND% -s "%PROFILE% Failed!" -to %EMAIL%
@goto end

:end

@rem == You can safely skip this line if you don't want check the output...
@rem == potete cancellare tranquillamente la linea tottostante se non vi interessa vedere l'output
pause

 

Download the batch to send a file with Blat e Abakt