18.27 Rsync Remote Files
20210313
Rsync can be used to synchronise files locally or remotely.
Below we illustrate typical archival (-a
or --archive
)
synchronisations, printing a log of the activity (-v
or
--verbose
), compressing files during the transfer (-z
or
--compress
), with numbers in a human-readable format (-h
or
--human-readable
).
The long version, synchronising all local html files to a remote host (togaware.com):
The short version of the same synchronisation:
To also update permissions use --chmod=
. Here we ensure all the
remote files are readable by everyone.
To ignore any file or directory named cache we use --exclude
:
To ignore backup files identified as having a trailing tilde, for example:
To remove any remote files that are not in the current source directory
use --delete
:
Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0