rsync

Rsync

Rsync is command to sync files from dst to src. Compare to copy, rsync has a feature to track delete files.
Rsync covers remote copy.

rsync [option] src dst

Not target

Create exclude file and use –exclude-from option

rsync --exclude-from=filepath

filepath is exclude target file path.
File example:

text.txt
folder/

These are relative path. We should write one line one target. If you want to target directory, you need /

Copy directory

To copy folder, use -a option

rsync -a test

Permission Error

rsync: failed to set times on “xxxx”: Operation not permitted (1)

times means timestamp
When rsync is executed, update timestamp too, but if dst owner is not user which runs rsync, there is not permission
How to fix
Remove timestamp update if you don’t use –no-t

Ref

Rsyncによるファイル同期