Activity #4373
openCreate a .bat File for Database Backup Automation
100%
Description
Develop a Windows batch file (.bat) to automate the process of taking a PostgreSQL database backup. The script should:
Take a backup of the specified database using pg_dump.
Include the current date and time in the backup file name.
Store the backup file in a specific folder (e.g., D:\DB_Backup\).
Optionally compress the backup file into a .zip file.
Log the backup process with timestamps and status messages.
Technical Details:
Database: PostgreSQL
Host: 10.176.14.181
Port: 5432
Username: postgres
Password: postgres
Database Name: DigiPathoL,DCTCGlo
Backup Location: D:\DB_Backup\
Deliverables:
A working .bat file that performs the database backup automatically.
Documentation or comments within the script explaining each step.
A sample log file generated after running the script.