pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Automatic backup in windows
Date: Mon, 2 Aug 2021 07:42:40 -0500
Message-ID: <9e132212-cb7e-304f-9319-9a93e538321b@gmail.com> (raw)
In-Reply-To: <CAO7L2ZxC4YKdC8UnT2OzJ+5PiEW2u_fwb1ww9RN1HPjOnMNMKg@mail.gmail.com>
References: <CAO7L2ZxC4YKdC8UnT2OzJ+5PiEW2u_fwb1ww9RN1HPjOnMNMKg@mail.gmail.com>

What happened when you ran that script?

On 8/2/21 1:52 AM, obi reddy wrote:
> 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

-- 
Angular momentum makes the world go 'round.

view thread (3+ messages)  latest in thread

Message-ID: <9e132212-cb7e-304f-9319-9a93e538321b@gmail.com>
Permalink:  ../9e132212-cb7e-304f-9319-9a93e538321b@gmail.com/
Also on:    postgresql.org/message-id/9e132212-cb7e-304f-9319-9a93e538321b@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Automatic backup in windows
  In-Reply-To: <9e132212-cb7e-304f-9319-9a93e538321b@gmail.com>
  References: <CAO7L2ZxC4YKdC8UnT2OzJ+5PiEW2u_fwb1ww9RN1HPjOnMNMKg@mail.gmail.com> <9e132212-cb7e-304f-9319-9a93e538321b@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox