๐Ÿ“˜Backup & Restore Data to/from Remote Backup Server (with SSH Key Authentication)

This guide shows how to securely transfer data between a production server and a Remote Backup Server using rsync over SSH. It includes examples for both password-based and SSH key-based authentication, as well as JetBackup snapshot transfers.


๐Ÿ” Prerequisites for SSH Key Authentication

  1. Generate an SSH Key (if not already done): ssh-keygen -t rsa -b 4096
  2. Upload the public key (~/.ssh/id_rsa.pub) to your Remote Backup Server.
  3. Ensure your private key (~/.ssh/id_rsa) is accessible to the user initiating the rsync.

๐Ÿ” Backup: Production โž Remote Backup Server (with SSH Key)

rsync -av --progress -e "ssh -i ~/.ssh/id_rsa -p 36256" /home/example [email protected]:/buffer/example

๐Ÿ” Restore: Remote Backup Server โž Production (with SSH Key)

rsync -av --progress -e "ssh -i ~/.ssh/id_rsa -p 36256" [email protected]:/buffer/example /home/example

๐Ÿ“ฆ Backup JetBackup Snapshots (From within cPanel account, with SSH Key)

rsync -avR --progress -e "ssh -i ~/.ssh/id_rsa -p 45311" ./jetbackup_1_1_5c732966bdf5a655e55542e2/*/snap.2019-03-18* [email protected]:/buffer

๐Ÿ“ฅ Restore JetBackup Snapshots from Remote Backup Server (with SSH Key)

rsync -av --progress -e "ssh -i ~/.ssh/id_rsa -p 36256" [email protected]:/buffer/example /home/example

๐Ÿ“ Notes

  • Replace ~/.ssh/id_rsa with the path to your actual private key file if it’s different.
  • Ensure correct file/directory permissions on the SSH key (typically chmod 600).
  • Avoid using root access unless necessaryโ€”non-root users can be configured appropriately.
  • The --progress flag helps monitor transfers, especially over slower links.
Scroll to Top