Skip to content

Instantly share code, notes, and snippets.

@Misaka-0x447f
Last active August 5, 2025 19:12
Show Gist options
  • Select an option

  • Save Misaka-0x447f/76eefaba4ae1b240321e456a055768d9 to your computer and use it in GitHub Desktop.

Select an option

Save Misaka-0x447f/76eefaba4ae1b240321e456a055768d9 to your computer and use it in GitHub Desktop.
test rsync to synology server
rsync -r -t -v --progress --delete -s --exclude '*/node_modules/' --exclude '*/dist/' --exclude '*/out/' -e 'ssh -p xxxx' --dry-run /path/to/local/ rsync://<username>@nas.local:/path/to/remote
# 注意!在 rsync 命令中,源路径(SOURCE)末尾是否存在斜杠 (/) 是一个关键的语法细节,它直接影响是否会创建额外的目录结构。
# 当源路径 /patch/to/local 不带末尾斜杠时,rsync 会将 data 目录本身作为一个整体复制到目标路径 /path/to/remote/local 下。
# 当源路径 /patch/to/local/ 带末尾斜杠时,rsync 会将 data 目录本身作为一个整体复制到目标路径 /path/to/remote 下。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment