...
These are the keys I find most useful:
key | description |
---|---|
-v | verbose |
-u | update -> skip files that are newer on the receiver |
-r | recurse into directories |
-t | preserve modification times |
-p | preserve permissions -> Do not use when copying files to the Alliance! |
-l | copy symbolic links as symbolic links - see note below |
-L | transform symbolic link into referent file/dir - see note below |
Note: One can use only either '-l' or '-L'. By default symbolic links will not get transferred!
Source & destination
If the source contains more than one file the destination must be a directory.
Either the source or the destination can be on another computer, that is accessible via ssh.
If one of them is on another computer the source resp. destination location must be preceded by the name of the computer (HOST) and if the username is different also by the username on the remote computer:
[username@]HOST:source
resp.
[username@]HOST:destination
Putting transfer command in background
To be able to log out after having started a transfer one can "put the transfer command in the background" the following way:
rsync [keys] source destination > logfile 2>&1 &
The 'logfile' needs to be specified to be in an existing directory on the local computer. It will contain what usually appears on the scree when executing the command.
Examples
a) Narval → UQAM
To copying data from Narval to a computer at UQAM one needs to go on the UQAM computer and fetch the data from Narval with, for example:
rsync -ruvtp username_on_Narval@narval.computecanada.ca:source_on_Narval directory_at_UQAM
b) UQAM → Narval
To copying data from UQAM to Narval one needs to go on the UQAM computer and push the data from from UQAM, for example:
rsync -ruvt source_at_UQAM username_on_Narval@narval.computecanada.ca:destination_on_Narval
MacOS ou Linux (nos serveurs)
...