我正在尝试从我的 MacOS 机器 rsync 到在 Windows Azure 上运行的 Ubuntu 服务器。要 ssh 到它,我必须执行以下操作:
$ ssh -i myPrivateKey.key -p 22 me@me.cloudapp.net
Run Code Online (Sandbox Code Playgroud)
我认为密钥文件可能是 X509 公钥,如果有帮助的话(抱歉,我不是系统管理员)。无论如何,我可以使用上述命令成功 ssh。
现在我想将文件同步到远程服务器。我是否需要以.key某种方式提供文件作为选项?
正常的 rsync 命令失败:
$ sudo rsync -avz -e my/file me@me.cloudapp.net:/my/path
rsync: Failed to exec my/file: Permission denied (13)
rsync error: error in IPC code (code 14) at /SourceCache/rsync/rsync-42/rsync/pipe.c(86) [receiver=2.6.9]
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [receiver=2.6.9]
Run Code Online (Sandbox Code Playgroud) 我正在尝试运行以下命令:
$ psql -d template_postgis -f /usr/local/pgsql-9.1/share/contrib/postgis-2.0/postgis.sql
Run Code Online (Sandbox Code Playgroud)
它产生了大量的错误输出,其中我只能在我的 shell 中看到结尾——我需要看到开头才能弄清楚出了什么问题。
...
psql:/usr/local/pgsql-9.1/share/contrib/postgis-2.0/postgis.sql:6065: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:/usr/local/pgsql-9.1/share/contrib/postgis-2.0/postgis.sql:6075: ERROR: current transaction is aborted, commands ignored until end of transaction block
psql:/usr/local/pgsql-9.1/share/contrib/postgis-2.0/postgis.sql:6081: ERROR: current transaction is aborted, commands ignored until end of transaction block
Run Code Online (Sandbox Code Playgroud)
但是,如果我尝试将消息发送到文本文件:
$ psql -d template_postgis -f /usr/local/pgsql-9.1/share/contrib/postgis-2.0/postgis.sql > error.txt
Run Code Online (Sandbox Code Playgroud)
文本文件只包含三个命令:
SET
BEGIN
ROLLBACK
Run Code Online (Sandbox Code Playgroud)
那么为什么不是所有的输出都被发送到文本文件,我怎样才能看到所有的输出呢?