Subject | Re: [firebird-support] Firebird backup automatically |
---|---|
Author | Kjell Rilbe |
Post date | 2012-01-03T09:21:53Z |
Den 2012-01-03 09:58 skrev Mahesh Pratihari s�h�r:
single gbak command in the bat file - the same you run manually. You
could use current date and/or time to name the backup file. This is mine
(slightly modified for brevity, put all of it on a single line):
"c:\program files\firebird\firebird_2_1\bin\gbak" "D:\MyData\DB.fdb"
"D:\MyBackups\DB %date% %time::=.%.fbk" -b -nt -password masterkey -user
sysdba -verify -y "C:\MyBackups\Log\DB %date% %time::=.%.log" -z
It will create a gbak backup in the D:\MyBackups folder and name the
backup file with the current timestamp. it will also write all output to
a log file with similar name in a Log subfolder.
The %time% environment variable contains colons, which are illegal in
filenames, so I use %time::=.% to replace those colons with dots. The
general syntax for such substitutions is
%variablename:chartoreplace=chartoreplacewith%.
Good luck!
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
[Non-text portions of this message have been removed]
>Just schedule a suitable bat file using Task Scheduler? You only need a
> Hi,
>
> Could you please let me know how to take the backup in firebird
> automatically like sql server maintenance plan.
>
>
single gbak command in the bat file - the same you run manually. You
could use current date and/or time to name the backup file. This is mine
(slightly modified for brevity, put all of it on a single line):
"c:\program files\firebird\firebird_2_1\bin\gbak" "D:\MyData\DB.fdb"
"D:\MyBackups\DB %date% %time::=.%.fbk" -b -nt -password masterkey -user
sysdba -verify -y "C:\MyBackups\Log\DB %date% %time::=.%.log" -z
It will create a gbak backup in the D:\MyBackups folder and name the
backup file with the current timestamp. it will also write all output to
a log file with similar name in a Log subfolder.
The %time% environment variable contains colons, which are illegal in
filenames, so I use %time::=.% to replace those colons with dots. The
general syntax for such substitutions is
%variablename:chartoreplace=chartoreplacewith%.
Good luck!
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
[Non-text portions of this message have been removed]