IT:File Transfer (rsync and scp)

From Atmospheric and Oceanic Science
Revision as of 19:37, 5 May 2023 by Ambrish (talk | contribs) (Created page with "=Rsync= rsync is the standard way of transferring files between linux systems. A summary knowledge of the various flags/options of rsync will allow you to be more efficient transferring to/from AOS Linux, and Compute Canada/Calcul Quebec servers. In Microsoft Windows you will need to use scp for file transfers, if you are not using an ssh client like MobaXterm, which has rsync. ==Generic rsync== The most basic usage of ssh will allow for a generic transfer between 2 ma...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Rsync

rsync is the standard way of transferring files between linux systems. A summary knowledge of the various flags/options of rsync will allow you to be more efficient transferring to/from AOS Linux, and Compute Canada/Calcul Quebec servers. In Microsoft Windows you will need to use scp for file transfers, if you are not using an ssh client like MobaXterm, which has rsync.

Generic rsync

The most basic usage of ssh will allow for a generic transfer between 2 machines.

Template Example
rsync file1 "login_name"@"machine2_name":"path_to_target_file" ssh myfile ambrish@glouton.meteo.mcgill.ca:myfile

will transfer myfile from the current machine onto path_to_target_file on "machine2_name".

Flags

You can also use you default home directory path in the command if you specify just colon (:) in the rsync command as the destination. Rsync supports a number of flags for transfers. A complete list is in the rsync man pages, but the most used ones are archive (-a) and verbose (-v). To show the progress of transfers, the --show-progress flag is sometimes useful

Template Example
rsync -a myfile "login_name"@"machine_name": ssh myfile ambrish@zephyr.meteo.mcgill.ca:
rsync -av --show-progress mydirectory "login_name"@"machine_name":"path_to_file" rsync -av --show-progress Downloads ambrish@qanik:/storage/ambrish/files_from_other_server