Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zoonderkins/6a39c164e8671e35682da46c995d7cd6 to your computer and use it in GitHub Desktop.
Save zoonderkins/6a39c164e8671e35682da46c995d7cd6 to your computer and use it in GitHub Desktop.
several method backup or sync between server

Rsync method

backup-server --> rsync + ssh --> source server
rsync -avzh --progress -e "ssh -p 2222 -i /root/ssh_cert/id_ed25519" -r [email protected]:/nextcloud/ ./

Tar gz on the fly

source server --> targz + ssh --> backup-server
tar zcvf - /your/directory | ssh -i private.key backup-user@backupserver "cat > /backup/file.tgz"

source: https://serverfault.com/a/984910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment