Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAXHP-00012h-BB for pgsql-general@arkaria.postgresql.org; Mon, 02 Aug 2021 12:42:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mAXHO-0005tv-5x for pgsql-general@arkaria.postgresql.org; Mon, 02 Aug 2021 12:42:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAXHN-0005sA-NS for pgsql-general@lists.postgresql.org; Mon, 02 Aug 2021 12:42:49 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mAXHH-0006p8-4g for pgsql-general@lists.postgresql.org; Mon, 02 Aug 2021 12:42:48 +0000 Received: by mail-ot1-x330.google.com with SMTP id z6-20020a9d24860000b02904d14e47202cso8609399ota.4 for ; Mon, 02 Aug 2021 05:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=7pPTkDtcLzODC326ErI31qB8oFsNiXqIcaTge/xpQE8=; b=GmSBDWUXIvc6OEUBYfz4BdDRtD9MbzPmSN89APWabXtyYNv0xjvYMIulJR0eqBbn39 ySftPUnMCog44Z4vQfWt3+Z4OEFGaZjvgrufI65Gg/VzZ55sQU658Su7n4pMIfClRIWd 7OO7uw0CKy5OZz6vGleQZG9WMnWSFmoKqQknEZyInoviCzwBkGaaDJW9KVyZ1agXPz8j QR5anPUwOdWHWyl+sBDdV6HEWCSIplm4fG1c/IWEnKH4YskLP4CpN5PBaysfbmPe0MAQ xHollPdwX1qMufgiOAGwbc9tSrDxWG66gpR3Qpwnh/eOP1sUOXJqC8FP7hpIrhhV9DLF akhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=7pPTkDtcLzODC326ErI31qB8oFsNiXqIcaTge/xpQE8=; b=IOE4gmVXEmkKXVtQyBAA1lSX0OjyPac1ELQCXeJrcby/wQqLrQ5voYq0HQtIKUvKtt 2QraqEALuY3VGZGrZrAK1efyuSpIS3z01J4vXG6n2gOGZWrycjyKww7NQbBQ9xvyTsi1 cVNh2r57L+WVwb7eUYGoYWnSg6A9l7Kqugd5XiRyJU9pzhl+7Oo54plbywYOvoemR/AB RoysiNjDsmQmrY/EULgbbZUuK36T6wq8JkjHaizfZ1gYJrlhDYHMnWlSgggHy6sMgfsf mBZxChCjKfpgHaiU2RXkTX6KfnxKXcKh35P0d9HGOSOOaYi9qf3nWdY95cry/RoHu2+B W6kg== X-Gm-Message-State: AOAM532b/qOJ4v+ww6sTRVTNBeB0MZtK7oYA9OP9k2ijarDtsVlE91OH hKnYcPzzYbqZ85Mg2gZ3tV77RBgreBCcSA== X-Google-Smtp-Source: ABdhPJzEs2sck0rxgDGYKRMfN07HaI2S8hVRACVlOW7WfLfDW74VNeGxfCsemag9yE0tiULeKRA82A== X-Received: by 2002:a05:6830:43a3:: with SMTP id s35mr11403463otv.262.1627908162129; Mon, 02 Aug 2021 05:42:42 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id l7sm1764457oie.32.2021.08.02.05.42.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Aug 2021 05:42:41 -0700 (PDT) Subject: Re: Automatic backup in windows To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: <9e132212-cb7e-304f-9319-9a93e538321b@gmail.com> Date: Mon, 2 Aug 2021 07:42:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------10861E0B5EE2A90CA3DF4F6D" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------10861E0B5EE2A90CA3DF4F6D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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. --------------10861E0B5EE2A90CA3DF4F6D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit 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.
--------------10861E0B5EE2A90CA3DF4F6D--