It makes a backup of procedures, triggers and views from a Firebird database. It is made to run on a server, preferably with cron.
FB Source uses Ruby, so you need to have it installed on your machine. I recommend installing Ruby via RVM or rbenv.
Clone the repository:
$ git clone https://github.com/mdamaceno/fb_source.git && cd fb_source
Create a file called .env with the following structure:
DATABASE_HOST=localhost
DATABASE_PORT=3050
DATABASE_NAME=/path-to-database/DATABASE.GDB
DATABASE_USERNAME=username
DATABASE_PASSWORD=password
OUTPUT_PATH=./output-path
Change the values as needed.
Go to FB Source's root folder and run the command:
$ ruby run.rb
This command generates the files with SQL script in the procedures, triggers and views folders located in output directory.
Optionally, you can change the output directory passing parameters to the command:
-o, --output PATH # custom output path
You can use FbSource with Docker if you want. Just use the following command:
$ docker run --rm --net host \
-e DATABASE_HOST=localhost \
-e DATABASE_PORT=3050 \
-e DATABASE_NAME=/path-to-database/DATABASE.GDB \
-e DATABASE_USERNAME=username \
-e DATABASE_PASSWORD=password \
-v $PWD/backup_fb:/output \
maadamaceno/fb_source
# OR
$ docker run --rm --net host \
--env-file $PWD/env \ # path to an env file
-v $PWD/backup_fb:/output \
maadamaceno/fb_source
Change $PWD/backup_fb to the path where you want to store the backup.
All the contributions are welcome. Submit your pull request!
This project is licensed under the MIT License.