有没有办法知道 ftp shell 脚本失败?
我有使用 shell 脚本 ftp 某些文件的经验。有些文件可能会丢失。例如我有100000个文件要ftp,可能有1或2个文件没有ftp,并且没有明显的错误。
当其中一个文件 ftp 失败时,shell 并没有停止,尽管我们不希望脚本因为只丢失 1 个文件而停止,但我们仍然希望它能得到一些反馈以知道存在问题。
如果我们用java来ftp会更好吗?
I have an experience of using shell script to ftp some file. And some files could just missed. For example for I have 100000 files to be ftp, there might be 1 or 2 files haven't been ftp and there is no obvious error.
The shell didn't stop when one of the files failed to be ftp, although we don't want the script to stop due to only 1 missing file, we still want it to have some feedback to know there is a problem.
Would it be better if we use java to ftp?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能根本不应该使用 ftp——而是考虑像 rsync 这样的东西,它可以重新启动失败的传输,并且只传输自上次以来更新的文件。
You should probably not use ftp at all -- but rather consider something like rsync which can restart failed transfers and only transfer the files which has been updated since last.
你问java是否更好这一事实让我认为你更精通java。最好使用您更熟悉的语言。
除非是 perl ;) j/k
The fact that you are asking if java is better makes me think you are more proficient in java. It's probably best to use whatever language you are more comfortable with.
Unless it's perl ;) j/k