Schedule Daily Database Backup
You can set an automated schedule for backing up
a server based database every day using the Windows Scheduled Tasks utility and the
appropriate batch file available below.
Step 1: Download the batch file for your
database below and save it on your database server.
- For convenience, it is
suggested that you save the file to the "C:\Program
Files\Firebird" directory.
- To download the batch file, right-click on the link and select "Save Target As" or "Save Link As".
Step 2: Schedule the batch file to run daily
using the Windows Scheduled Tasks utility.
- In Windows, go to Start --> All Programs -->
Accessories --> System Tools --> Scheduled Tasks
or Start --> Run --> control.exe schedtasks
- Click "Add a scheduled task"
- Click "Next"
- Click "Browse..." and then select the batch file you downloaded in Step
1.
- Select the radio button to perform this task "Daily"
- Click "Next"
- Select a start time and then click the "Next" button.
- Enter the user name and password for the Windows account which will be
used to execute the task, and then click the "Next" button.
- Click the "Finish" button.
Step 3: Run the scheduled task and confirm that the backup file is created
successfully.
- Double-click on the scheduled task you just created.
- A console window will open and execute the command automatically
before closing.
- After the window closes, confirm that a backup file has been created in the
folder at C:\Backup.
- The backup file will be compressed, and may be much smaller than the
uncompressed database file.
- When finished, log off the computer and allow the backup task to run at it's
scheduled time, and then confirm that a new file has been created when the task
ran as scheduled.
More information about the batch file:
- By default, the batch file will keep the 10 most recent backups of your database.
- On the 11th day, the oldest backup file will be replaced with the current
backup file.
- Backup files are named using the database name plus a number at the end. The most
recent backup file ends with the number 1. The oldest backup file ends
with the number 10.
- The default backup location is at C:\Backup.
- The default number of copies to keep and the default backup location may be
changed by editing the batch file in Notepad.
- Right click on the batch file and select "Edit" to make changes.
- Change only the values listed in the SET statements at the top of the
batch file.
- Make only one change at a time, and test between each change to aid
troubleshooting if necessary.