简体   繁体   English

rsync到没有目标目录的远程

[英]rsync to remote without destination directory

I have run an rsync command to send local files to a remote server, but I forgot to specify the destination directory. 我已经运行了rsync命令,将本地文件发送到远程服务器,但是我忘记了指定目标目录。 Where in the remote server have the files been copied? 将文件复制到远程服务器中的何处? I ran the following command: 我运行了以下命令:

rsync -avz source_directory/ remote_user@192.168.1.100

The output says the files were transmitted, and if I run the same command again, it doesn't transmit the files, becouse there is no change. 输出显示文件已传输,如果再次运行相同的命令,则不会传输文件,因为没有更改。 But I cant find the files in the remote server. 但是我找不到远程服务器中的文件。

Unless rsync sees a colon ( : ) in the destination (or source) parameter it uses it as a local path. 除非rsync看到一个冒号( : )在目标(或源)参数,它使用它作为一个本地路径。 man rsync gives a hint : 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

        [...]

And later: 然后:

The remote-shell transport is used whenever the source or destination path contains a single colon (:) separator after a host specification. 只要源或目标路径在主机规范之后包含单个冒号(:)分隔符,就使用远程外壳传输。

Ie no colon in either SRC or DEST and you're using the 'Local' variant. 也就是说, SRCDEST中都没有冒号,而您使用的是“本地”变体。

( scp has this habit too, as noted in numerous frustrated rants by its users.) scp也有这种习惯,正如它的用户在许多沮丧的咆哮中所指出的那样。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM