Original link: https://hsiaofeng.com/archives/225.html
rsync is a Linux software for file synchronization, which can realize file synchronization between local-local or local-remote. Using rsync, when updating a static website, it is not necessary to package the whole site, and only update the parts that need to be updated, saving server bandwidth and time.
rsync -avuz 本地路径用户名@服务器地址:远程路径
rsync -avuz /mnt/e/wwwroot/html/ [email protected]:/var/www/html/
-ameans archive mode, including recursion, saving all metadata, such as modification time, permissions, owner, etc., and soft links will also be synchronized.
-umeans to skip files that are newer than local in the target directory.
-vmeans output verbose.
-zmeans to compress the data when synchronizing.
Reference: rsync usage tutorial – Ruan Yifeng’s weblog
This article is transferred from: https://hsiaofeng.com/archives/225.html
This site is only for collection, and the copyright belongs to the original author.