Skip to content

Instantly share code, notes, and snippets.

@seahrh
Last active January 18, 2022 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seahrh/f566876adb5757a487183cd01aa1cef2 to your computer and use it in GitHub Desktop.
Save seahrh/f566876adb5757a487183cd01aa1cef2 to your computer and use it in GitHub Desktop.
prefer rsync to scp. See https://linux.die.net/man/1/rsync
# -v, --verbose
# -a, --archive want recursion and preserve almost everything
# -P same as --partial --progress
# -z, --compress compress file data during the transfer
rsync -vaPz file.txt user@server:~/user
rsync -vaPz dir user@server:~/user
rsync -vaPz user@server:~/user/file.txt .
rsync -vaPz user@server:~/user/dir .
# from local laptop
ssh -O exit hostname
ssh -A hostname
# on hostname, check your agent
ssh-add -L
# assuming ^ gives results, do the work
rsync ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment