Rsync: Difference between revisions

From James's Wiki
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:


NOTE: It might be possible to set the default ssh port in ~/.ssh/config so specifying the remote port all the time will be unnecessary.
NOTE: It might be possible to set the default ssh port in ~/.ssh/config so specifying the remote port all the time will be unnecessary.
backup dir1 to dir2 and delete missing from dir2
rsync -a --delete /media/hdd1/data-1/ /media/hdd2/data-2/
rsync with progress
rsync -av --info=progress2 root@nas01:/tmp/*Office* .
rsync options source dest | pv -lpes Number-Of-Files
rsync -vrltD --stats --human-readable /tmp/software /nas10 | pv -lep -s 42 >/dev/null
options:<br>
-n = dry run
source=https://www.cyberciti.biz/faq/show-progress-during-file-transfer/

Latest revision as of 22:56, 20 January 2021

To copy files to a remote server

rsync -e 'ssh -p 2222' *.txt username@batman:/tmp


NOTE: It might be possible to set the default ssh port in ~/.ssh/config so specifying the remote port all the time will be unnecessary.

backup dir1 to dir2 and delete missing from dir2

rsync -a --delete /media/hdd1/data-1/ /media/hdd2/data-2/


rsync with progress

rsync -av --info=progress2 root@nas01:/tmp/*Office* .
rsync options source dest | pv -lpes Number-Of-Files
rsync -vrltD --stats --human-readable /tmp/software /nas10 | pv -lep -s 42 >/dev/null

options:
-n = dry run

source=https://www.cyberciti.biz/faq/show-progress-during-file-transfer/