meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:rsync [2025/03/30 19:56] niziaklinux:rsync [2025/12/29 15:40] (current) – [get changes to separate dir] niziak
Line 1: Line 1:
 ====== rsync ====== ====== rsync ======
 +
 +===== mv & cp replacement =====
 +
 +[[https://wiki.archlinux.org/title/Rsync]]
 +
 +<code bash>
 +cpr() {
 +  rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 "$@"
 +
 +mvr() {
 +  rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files "$@"
 +}
 +</code>
 +
 +Above command doesn't delete directories. There is no method do perform this in safe manner (do not use ''--delete'' !!!).
 +Best workaround is to delete empty source dirs manually:
 +
 +<code bash>
 +find . -type d -empty -delete
 +</code>
  
 ===== get changes to separate dir ===== ===== get changes to separate dir =====
  
-Option ''--compare-dest'' also compare destination files relative to DIR.+Option ''--compare-dest'' also compares destination files relative to DIR.
 > If DIR is a relative path, it is relative to the destination directory > If DIR is a relative path, it is relative to the destination directory