Rsync: Difference between revisions

No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Lowercase title}}
See [[Archwiki:rsync]] and [https://linux.die.net/man/1/rsync rsync(1) - Linux man page]
See [[Archwiki:rsync]] and [https://linux.die.net/man/1/rsync rsync(1) - Linux man page]


==Getting Started==
==Getting Started==
<pre>
<pre>
rsync -a <src> <dst> --info=progress2
rsync -ah <src> <dst> --info=progress2
</pre>
</pre>


;Flags
;Flags
* <code>-a</code> archive mode (recursive, preserves symlinks, permissions, times, group, owner, devices)
* <code>-a</code> archive mode (recursive, preserves symlinks, permissions, times, group, owner, devices)
** Excludes hard links (<code>-H</code>), ACLs (<code>-A</code>), and extended attributes (<code>-X</code>)
* <code>--no-i-r</code> or <code>--no-inc-recursive</code> scans all files at the beginning rather than during the transfer
* <code>--no-i-r</code> or <code>--no-inc-recursive</code> scans all files at the beginning rather than during the transfer
* <code>--progress</code> shows per-file progress
* <code>--progress</code> shows per-file progress
Line 22: Line 24:
EXCLUSIONS='--exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"}'
EXCLUSIONS='--exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"}'


sudo rsync -aAXq ${EXCLUSIONS} / "${TARGET_FOLDER}"
sudo rsync -aAXh ${EXCLUSIONS} / "${TARGET_FOLDER}" --info=progress2
</pre>
</pre>