rsync one-way mirror synchronization

By default, rsync only ensures that all contents of the source directory (excluding explicitly excluded files) are copied to the destination directory. It does not keep the two directories identical and does not delete files. If you want the destination directory to be a mirror copy of the source directory, you must use the --delete option, which deletes files that exist only in the destination directory and not in the source directory.

rsync -av --delete source/ destination

In the command above, the --delete option makes the destination a mirror of the source.

More Usage

【转载】rsync怎么用 - :hammer_and_wrench:工具与编程 / :laptop:编程 - 始徒Beginner