Automatic backup in windows

From: obi reddy <obireddy(dot)g1997(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Automatic backup in windows
Date: 2021-08-02 06:52:15
Message-ID: CAO7L2ZxC4YKdC8UnT2OzJ+5PiEW2u_fwb1ww9RN1HPjOnMNMKg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello everyone, I want to schedule the automatic backup in windows
postgresql platform.

I have attached the script, if any changes is required please correct and
send back. This is my humble request.
Actually I don't know to write the windows script. Otherwise if incase any
have the script please send me .

Db name:rathi26
Backup file path:C:\Users\gangireddyobiredy\Desktop\case.sql

Thank you And Regards
Obireddy. G

@echo off
SET day=%date:~0,2%
SET month=%date:~7,8%
SET year=%date:~6,4%
SET hh=%time:~0,2%
SET mm=%time:~3,2%

SET BACKUPDIR=C:\users_Backup
SET datestr=%day%-%month%-%year%_%hh%-%mm%
SET dir=%day%-%month%-%year%
mkdir C:\users_Backup%dir%

#Provide database name here
SET db1=dbname1

echo datestr is %datestr%

SET BACKUP_rathi26=C:\Users\gangireddyobiredy\Desktop\case.sqll
SET rathi26=%db1%%datestr%.sql

ECHO Backup file name is %rathi26%

SET PGPASSWORD=
echo on

#Execute Backup for database
C:\Program Files\PostgreSQL\13\bin>pg_dump.exe -p 5432 -U postgres -v -d
rathi26 > C:\Users\gangireddyobiredy\Desktop\case.sql
echo Backup Completed

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2021-08-02 12:42:40 Re: Automatic backup in windows
Previous Message Vijaykumar Jain 2021-08-01 18:01:51 Re: postgres vacuum memory limits