Jump to content
Yaron

Zero cost, fully automated secure off-site database backup (FireBird 3.0.4)

Recommended Posts

It took me hours of research to find the tools & documentation and haven't found any up-to-date text describing a similar process, so I decided to post my findings here in case someone else has the same requirement.

 

I wrote (in Delphi) a simple windows service that runs the FireSQL "nbackup.exe" command line tool to create a DB backup every [x] hours using this command line:

"c:\Program Files\Firebird\Firebird_3_0\nbackup.exe" -U SYSDBA -P [password] -B 0 "c:\path\database.FDB" "[output_file]"

 

The windows service keeps [x] number of backup files (erasing old files) and creates a new backup every [y] minutes.  Personally, I used 1 full-db backup per hour, covering an entire week (168 files).

 

I then use the open-source SyncThing P2P file sync tool (also running as a windows service) to securely & automatically sync the DB backups with every PC assigned as off-site backup.

 

100% automated, secure, zero cost.

Edited by Yaron
  • Thanks 2

Share this post


Link to post

In case you are taking your off-site backups on a Linux server, you might want to have a look at scp (Secure Copy). On Windows there is Putty which is free and has pscp.exe doing same job.

 

 

 

  • Like 1

Share this post


Link to post
3 hours ago, ertank said:

In case you are taking your off-site backups on a Linux server, you might want to have a look at scp (Secure Copy). On Windows there is Putty which is free and has pscp.exe doing same job.

 

 

 

SyncThing has a Linux/Mac/FreeBSD/etc... client, so in theory the off-site backups can be on pretty much any widely used OS.

Share this post


Link to post
On 9/27/2019 at 5:42 PM, Yaron said:

I wrote (in Delphi) a simple windows service that runs the FireSQL "nbackup.exe" command line tool to create a DB backup every [x] hours

Was Task Scheduler not good enough for this?

Share this post


Link to post

I did something similar with gbak i.c.w. nextcloud and the task scheduler (inside a cmd-script).

 

Any reason to prefer nbackup above gbak?

 

Share this post


Link to post
57 minutes ago, rvk said:

Any reason to prefer nbackup above gbak?

 

Not my quote:

Quote

 

nbackup is a new backup utility that comes with Firebird 2.0. It offers possibilities not present in gbak - Firebird's pre-existing backup tool - but doesn't replace the latter. Both programmes have their strengths and weaknesses; they will likely coexist for some time to come.


 

I basically used it cause that's the example I was able to find in the documentation for exporting the DB.

 

 

1 hour ago, Cristian Peța said:

Was Task Scheduler not good enough for this?

In theory I could have used the windows task scheduler, but I needed more control and I'm using the service to perform other timed DB actions.

And I couldn't just call nbackup directly from the task scheduler as I'm erasing old DB files and numbering new backups based on existing backup file names (a running counter in the file name) and some more logic is required for this.

 

Share this post


Link to post

Ah, Ok. I wanted my backup script to make transportable backups. nbackup doesn't do that (but is faster because of it). Because speed isn't an issue (because both can backup a database while in use and I only make daily backups, not hourly) I went for gbak.

 

https://firebirdsql.org/manual/nbackup-overview.html

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×