Untitled

 avatar
unknown
plain_text
a year ago
571 B
2
Indexable
#!/bin/bash

# Source Server Details
source_username="your_username"
source_host="source_server_ip"
source_database="your_database_name"

# Destination PC Details
destination_username="your_username"
destination_host="destination_server_ip"
destination_backup_path="/path/to/backup.sql"

# Backup the PostgreSQL database
pg_dump -U "$source_username" -h "$source_host" -d "$source_database" -f "$destination_backup_path"

# Transfer the backup to the destination PC
scp "$destination_backup_path" "$destination_username@$destination_host:/path/on/destination/backup.sql"
Editor is loading...
Leave a Comment