0
我正在使用net-sftp gem访问sftp帐户中的文件。我做喜欢从一个SFTP帐户100多个文件复制到其他一些批量操作,但我得到了一个错误:为什么我得到一个sftp超时错误?
Net::SFTP::StatusException (4, "failure")
我认为这是因为从一个会话时发生或缓冲区大小限制?如果是这种情况,我该如何增加限制,以便可以对超过100个文件执行批量操作。
这里是堆栈跟踪:
Net::SFTP::StatusException (4, "failure")
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:845:in `wait_for'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net /sftp/session.rb:589:in `rename!'",
"/home/xxxxx_user/prod/lib/tasks /xxxxx_rfa_intake.rake:72:in `move'",
"/home/xxxxx_user/prod/lib/tasks /xxxxx_rfa_intake.rake:61:in `process'",
"/home/xxxxx_user/prod/lib/tasks /xxxxx_rfa_intake.rake:26",
"/home/xxxxx_user/prod/lib/tasks /xxxxx_rfa_intake.rake:20:in `each'",
"/home/xxxxx_user/prod/lib/tasks/xxxxx_rfa_intake.rake:20",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:938:in `call'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:938:in `do_version'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:938:in `each'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:938:in `do_version'",
"/usr/local/lib/ruby/gems/1.8/gems/net-sftp-2.0.2/lib/net/sftp/session.rb:908:in `when_channel_polled'",
"/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `to_proc'",
"/usr/local/lib/ruby/gems/1.8/gems/net-ssh-2.0.21/lib/net/ssh/connection/channel.rb:311:in `call'",
这里是我的代码Net :: SFTP.start(“host”,“username”,:password =>“password”)do | sftp | sftp.dir.entries(@path).each do | entry | 移动(SFTP,入境,从@,@processed_path) 结束 结束 高清移动(遥控器,射频消融,从,到) remote.rename!( “#{}从/#{} rfa.name” ,“#{to} /#{rfa.name}”)//这一行出现错误 end – 2012-01-13 10:21:42
对于前几个文件,它的工作状态很好,大概在100之后它会发出这个错误。 – 2012-01-13 10:23:56