在 sftp put 命令之间休眠
有没有一种方法可以使用-c
命令执行sftp
,并且在文本文件中指定了sleep> sleep> sleep
命令在两个put 命令?
我有一个批处理文件,该文件将SFTP并执行一些put
命令。我希望该过程在执行几个put
命令后等待5分钟。
sftp -b commands.txt ..
在commands.txt
我想要的:
put abc.txt
wait 5 mins
put xyz.txt
最坏的情况下,我可以将其在批处理文件中将其拆分为两个TXT文件,但是想知道是否有一种更简单的方法。通过sftp
人页面没有找到任何可以做到这一点的东西。
Is there a way to execute sftp
with the -c
command and in the text file specify an equivalent of sleep
command to wait between two put
commands?
I have a batch file that will sftp and execute a few put
commands. I want the process to wait for 5 min after executing a few put
commands.
sftp -b commands.txt ..
and in commands.txt
I want:
put abc.txt
wait 5 mins
put xyz.txt
Worst case I could split it in my batch file into two txt files, but was wondering if there was an easier way so I don't have an extra file to maintain. Went through the sftp
man pages didn't find anything that does that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将命令通过管道传送到
sftp
。这允许您使用 shellsleep
命令。当然,您也可以在两个单独的 sftp 命令之间休眠。特别是,在长达 5 分钟的暂停时间内,连接中断的可能性不容忽视。
在 Windows 上,将
sleep 5m
替换为:Pipe the commands to the
sftp
. That allows you to use shellsleep
command.You can of course sleep between two individual
sftp
commands too. Particularly, with such a long pause as 5 minutes, chances that the connection breaks meanwhile are not negligible.On Windows, replace the
sleep 5m
, with: