Project

General

Profile

Actions

Activity #4373

open

Create a .bat File for Database Backup Automation

Added by Aswathy M G 9 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Start date:
10/29/2025
Due date:
% Done:

100%

Estimated time:
Planned Due Date:
10/30/2025

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.

Actions

Also available in: Atom PDF