Avatar of Skumar_CCSA
Flag for India

asked on 

vbscript, scripts, postgresql,batch file, automate, windows 2008

Hi experts..

I running the below script everyday using task scheduler to backup the database locally , and save along with the current date and time.
I need your help how to enhance little bit to rotate the backup copy, keep the latest copy and delete the previous copies.

set PGPASSWORD=password123
@echo off
set datetime=%date:~-4%_%date:~-7,2%_%date:~-10,2%_%time:~0,2%_%time:~3,2%_%time:~6,2%
echo %datetime%
"D:\Program Files\VASCO\PostgreSQL\bin\pg_dump" -f "D:\Program Files\VASCO\IAS-Backup\DB_BK\PRI_AUTH_DB_BAK_%datetime%.bak" -Fc -Z9 -U username -v databaseinstance

please help me.
Scripting LanguagesVB ScriptPostgreSQL

Avatar of undefined
Last Comment

8/22/2022 - Mon