Skip to content

Instantly share code, notes, and snippets.

@sibsfinx
Last active December 5, 2023 17:11
Show Gist options
  • Save sibsfinx/dde1877ab60c185882cd to your computer and use it in GitHub Desktop.
Save sibsfinx/dde1877ab60c185882cd to your computer and use it in GitHub Desktop.
clone ubuntu server with rsync

This script is pulling files from username@hostname:/* to / on the current server. So you need to ssh to the target server and and run it. Tested when migrating between two DigitalOcean droplets a while ago.

sudo rsync -aAXvP --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/etc/sysconfig/network-scripts/*","/etc/network/interfaces"} username@hostname:/* /
@jorisw
Copy link

jorisw commented Jul 7, 2023

What's the source and what's the destination here? Does this pull or push data?

@sergeypal
Copy link

What's the source and what's the destination here? Does this pull or push data?

It's pulling data. Source is first arg, destination is second.

@sibsfinx
Copy link
Author

sibsfinx commented Dec 5, 2023

Sorry for not replying for so long, and thank you @sergeypal for the comment. I've updated the gist

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