SSH列表远程文件通过rsync Fails flofs-将远程文件传递给GNU

问题描述 投票:0回答:1
此Shell命令的性质是列出远程服务器文件,将它们管道并并行,然后将它们从远程服务器rsync rsync rsync rsync,如下所示,

ssh -o ConnectTimeout=10 -i /home/ec2-user/.ssh/remote.pem [email protected] \ -q -t 'find /var/log/ -type f -print0' \ | parallel -j 5 -0 rsync -aPvv -e "ssh -i /home/ec2-user/.ssh/remote.pem" \ [email protected]:{} /home/ec2-user/local_log/

报告的错误消息是

Unexpected remote arg: [email protected]:/var/log/DAILY.123.gz rsync error: syntax or usage error (code 1) at main.c(1358) [sender=3.1.3]

用户在/var/log/*
远程服务器目录上已读取访问权限

任何提示或建议都将不胜感激。

1st答案

thanks为建议,并带有修复'{}',但出现相同的错误。

这里的问题是,并行不正确地格式化rsync命令。 Rsync命令期望一个源和目的地,但是并行的方式{}是不正确的。 确定{}的前缀与远程主机名正确相结合。 修改您的命令如下:

SSH-O ConnectTimeOut = 10 -I/Home/ec2-user/.ssh/remote.pem
linux shell gnu rsync gnu-parallel
1个回答
0
投票

-Q -T'find/var/log/-type f -print0'|

并行-j 5 -0 rsync -apvv -e“ ssh -i/home/ec2-user/.ssh/remote.pem”

[电子邮件保护]

:'{}'/home/ec2-user/local_log/

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.