rsync到没有目标目录的远程

rsync to remote without destination directory

我有 运行 一个 rsync 命令将本地文件发送到远程服务器,但我忘记指定目标目录。文件被复制到远程服务器的哪个位置?我 运行 以下命令:

rsync -avz source_directory/ remote_user@192.168.1.100

输出表明文件被 t运行 发送,如果我再次 运行 相同的命令,它不会 运行 发送文件,因为没有改变。但是我无法在远程服务器中找到文件。

除非 rsync 在目标(或源)参数中看到冒号 (:),否则它会将其用作本地路径。 man rsync 给出了 提示:

 SYNOPSIS
        Local:  rsync [OPTION...] SRC... [DEST]

        Access via remote shell:
          Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]
          Push: rsync [OPTION...] SRC... [USER@]HOST:DEST

        [...]

以后:

The remote-shell transport is used whenever the source or destination path contains a single colon (:) separator after a host specification.

SRCDEST 中都没有冒号,并且您使用的是“本地”变体。

scp 也有这个习惯,正如其用户在无数沮丧的咆哮中指出的那样。)