beautypg.com

Creating the database backup script, Creating the scheduled task – Acronis Access - Installation Guide User Manual

Page 28

background image

28

Copyright © Acronis International GmbH, 2002-2014

Creating the database backup script

1. Open Notepad (or another text editor) and enter the following:

@echo off

for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (

set dow=%%i

set month=%%j

set day=%%k

set year=%%l

)

set datestr=%month%_%day%_%year%

echo datestr is %datestr%

set BACKUP_FILE=AAS_%datestr%_DB_Backup.sql

echo backup file name is %BACKUP_FILE%

SET PGPASSWORD=password

echo on

bin\pg_dumpall -U postgres -f %BACKUP_FILE%

move "%BACKUP_FILE%" "C:\destination folder"

2. Replace "password" with the password for user postgres you have entered when you installed

Acronis Access.

3. Replace C:\destination folder with the path to the folder where you want to save your backups.
4. Save the file as DatabaseBackup.bat (the extension is important!) and select All Files for the file

type.

5. Move the file to the PostgreSQL installation folder in the version number directory (e.g. \9.3\).

Creating the scheduled task

1. Open the Control Panel and open Administrative Tools.
2. Open the Task Scheduler.
3. Click on Action and select Create Task.

On the General tab:

1. Enter a name and description for the task (e.g. AAS Database Backup).
2. Select Run whether user is logged in or not.

This manual is related to the following products: