Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
571 B
0
Indexable
Never
#!/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"
Leave a Comment