| #FAQ: 10073-EN, Date: 7/4/2005 How to automate the backup of the database of OroMailCenter using the Firebird "gbak" utility. |
| The information in this article applies to : OroMailCenter 1.x (English) OroMailCenter 1.x (French) Description The gbak utility included with Firebird is a command line utility. This utility can be called from a script file and you can schedule the script from a task scheduler software such as the schedule service under Windows NT/2000/XP/2003 or the cron daemon under Linux or Unix. Solution You just have to call the gbak utility from the script file. Refer to the OroMailCenter 1.0 installation guide for more information about backing up the database.
Example of a script under Windows This example backups the OroMailCenter database (file omc.fdb) that is located in the C:\Program Files\OroLogic\OroMailCenter folder on the Windows server then create the file omc.fbk in the same folder. The gbak utility is located in the C:\Program Files\Firebird\Firebird_1_5\bin\ folder. This script is ran directly from the server. REM BEGIN SCRIPT "C:\Program Files\Firebird\Firebird_1_5\bin\gbak" -B -USER SYSDBA -PASSWORD masterkey "C:\Program Files\OroLogic\OroMailCenter\omc.fdb" "C:\Program Files\OroLogic\OroMailCenter\omc.fbk" REM END SCRIPT Important notice: The command above will work only if it is run directly from the server console. This command will not work if you run it through a client terminal server session or for example if the command is run in background from a task scheduler software. In such case, you must specify the server name as well as the port number on which Firebird is running (TCP/IP syntax). Usually, the default port number used is 3050. Verify your OroMailCenter connection parameters to see which port number to use in the command. Here is the same example as above, except that the server name and port number is specified: REM BEGIN SCRIPT "C:\Program Files\Firebird\Firebird_1_5\bin\gbak" -B -USER SYSDBA -PASSWORD masterkey "localhost/3050:C:\Program Files\OroLogic\OroMailCenter\omc.fdb" "C:\Program Files\OroLogic\OroMailCenter\omc.fbk" REM END SCRIPT In this example, the server is named localhost and the port number on which Firebird is running is 3050. Note that you must add the character / between the server name and the port number and add the character : after the port number. Please, also note that you could enter the IP address of the server instead of its name. Example of a script under Linux or Unix This example backups the OroMailCenter database (file omc.fdb) that is located in the /home/oromailcenter folder on Linux or Unix server and create the backup file omc.fbk in the same folder The gbak utility is located in the /opt/firebird/bin folder. This script is ran directly from the server. # BEGIN SCRIPT /opt/firebird/bin/gbak -b -user SYSDBA -password masterkey /home/oromailcenter/omc.fdb /home/oromailcenter/omc.fbk # END SCRIPT A .fbk file is a special Firebird backup file format. To be able to restore a database from a .fbk file, you must obligatory restore the file using the Firebird gbak utility. For more information about the gbak utility, refer to the Firebird documentation. For more information about script files, refer to your operating system documentation. Once you backed-up your database, we recommend you to store a copy of your backup file on tape or other media. For further information on tape or other media to use for storage, ask your computer's sales representative. Status Information
Revision 2 |
| © 1996-2008 OroLogic Inc. |