Subject AW: [firebird-support] Scheduled Backup
Author Steffen Heil
Hi

> Is there a way to schedule a backup with firebird? Also, if there is
> can I put the date in the filename so I know when the backup is of?

Usually, you do more than a database backup at a time.
So it would be better to have the date in the folder name containing all
backups.

> This is for Windows:
> Create a batch file (C:\bckp.cmd) with these 2 commands (just 2 lines!)
> del C:\BCKP\db.gbk
> "C:\Program Files\Firebird\Firebird_1_5\bin\gbak" -b -v -user SYSDBA
-passw
masterkey D:\DB\db.fdb C:\BCKP\db.fbk

Or, use these 4 lines:

set folder=<backupfolder>\%date:~6,4%-%date:~3,2%-%date:~0,2%
md %folder%
ntbackup backup <sourcefolder> /j "<backupname>" /f
"%folder%\<backupname>.bkf" /v:yes /l:s /snap:on
gbak -b -user sysdba -pas <password> <db> %folder%\<databasename>.gbk

You will end up with a folder for every day which contains all backups.
You might leave "/snap:on" out, if you do not use Windows Server 2003.

> at 18:00 /interactive /every:M,T,W,Th,F,S,Su C:\bckp.cmd

This is still required though you might simply use "Scheduled Tasks" in
explorer instead of "at".

> dont think you can build a DATE/TIME into the filename, unless you manage
to do some fancy renaming after the backup finishes.

.. see above

Regards,
Steffen