Backup! Backup! Backup!
The three most important aspects of managing an enterprise application as explained to me by one of the key personnel for the current client I’m working for. She hasn’t failed to stress enough, the need to ensure timely and complete backups.
I haven’t been managing the deployed application but I noticed that the team looking after essbase was taking backups manually. Somehow they weren’t comfortable with the command line interface to automate their task so I thought I’d chip in and hammer out a primitive backup method to help them out.
I think there are better and more elegant solutions out there, so if any of my readers’ feel that they have a better one I’d really appreciate if they can give in their suggestions.
My method was pretty simple, it consists of a batch file that launches an esscmd script. The reason I use a batch file to launch the script is to ensure that the backup files generated are then moved to a specified location and timestamped for archiving purposes.
The code for the batch file is as follows:
REM Backup current directory
DEL %BACKUPPATH%\AD.TXT /f /q
DEL %BACKUPPATH%\ADC.TXT /f /q
DEL %BACKUPPATH%\L0.TXT /f /q
DEL %BACKUPPATH%\L0C.TXT /f /q
DEL %BACKUPPATH%\ILDB.TXT /f /q
DEL %BACKUPPATH%\ILDBC.TXT /f /q
MOVE %ARBORPATH%\app\AD.TXT %BACKUPPATH%\
MOVE %ARBORPATH%\app\ADC.TXT %BACKUPPATH%\
MOVE %ARBORPATH%\app\L0.TXT %BACKUPPATH%\
MOVE %ARBORPATH%\app\L0C.TXT %BACKUPPATH%\
MOVE %ARBORPATH%\app\ILDB.TXT %BACKUPPATH%\
MOVE %ARBORPATH%\app\ILDBC.TXT %BACKUPPATH%\
if “%time:~0,1%”==” ” set hour=0%time:~1,1%
REN %BACKUPPATH%\AD.TXT %_my_datetime%-AD.TXT
REN %BACKUPPATH%\ADC.TXT %_my_datetime%-ADC.TXT
REN %BACKUPPATH%\L0.TXT %_my_datetime%-L0.TXT
REN %BACKUPPATH%\L0C.TXT %_my_datetime%-L0C.TXT
REN %BACKUPPATH%\ILDB.TXT %_my_datetime%-ILDB.TXT
REN %BACKUPPATH%\ILDBC.TXT %_my_datetime%-ILDBC.TXT
The esscmd script is very simple. It is:
LOGIN “LOCALHOST” “username” “password”;
SELECT “application” “database”;
EXPORT “AD.TXT” 1 0;
EXPORT “ADC.TXT” 1 1;
EXPORT “L0.TXT” 2 0;
EXPORT “L0C.TXT” 2 1;
EXPORT “ILDB.TXT” 3 0;
EXPORT “ILDBC.TXT” 3 1;