Skip to content

Instantly share code, notes, and snippets.

View yatharthranjan's full-sized avatar
👨‍💻
Codes are a puzzle. A game, just like any other game.

Yatharth Ranjan yatharthranjan

👨‍💻
Codes are a puzzle. A game, just like any other game.
View GitHub Profile
@yatharthranjan
yatharthranjan / rsync.md
Last active September 1, 2020 11:04
Rsync commands

To sync files from remote to local

rsync -avz --stats --dry-run --relative -e "ssh -i path/to/somekey" "[email protected]:/remote/path/./data/*/datatype/" ~/local/path/data/datatype/

Replace the local and remote path as per your requirements. This is for getting data from the datatype folder for all folders within the data folder. Put path to your ssh key in place of path/to/somekey and replace [email protected] with your connection string for your remote machine.

This does the following-

  1. --stats shows the progress and other statistics
  2. --dry-run performs a check run but does not tranfer any data. Remove it to actually intiate the data transfer