this post was submitted on 05 Jul 2023
11 points (100.0% liked)

Sysadmin

5587 readers
1 users here now

A community dedicated to the profession of IT Systems Administration

founded 5 years ago
MODERATORS
 

What are you favourite/useful rsync tricks these days?

Mine is rsync -r --chown=AUSER:AGROUP SRC DST to copy the files and change the ownership on the fly.

top 2 comments
sorted by: hot top controversial new old
[โ€“] dotslashme@infosec.pub 6 points 1 year ago

My personal favorite was when we were having issues with an ssh connection and discovered using the -P flag, which will allow you to resume transfers that disconnects and -z that enables compression.

So, for instance to get an ssh file transfer with resume support, using compression, you would use:

rsync -avPz -e ssh user@remote-ssh-server:/source destination

[โ€“] Hopfgeist@feddit.de 5 points 1 year ago

--info=progress2 for long transfers involving a large number of files. Gives continuously updated statistics on the whole transfer.