简体   繁体   English

NcFTP -S与-bb

[英]NcFTP -S with -bb

I am trying to upload all changed files to my FTP server. 我正在尝试将所有更改的文件上传到我的FTP服务器。 However, I cannot use -S .tmp and -v when I use the -bb flag - and I can't use those options with ncftpbatch at all. 但是,当我使用-bb标志时,我不能使用-S .tmp-v ,并且我完全不能在ncftpbatch中使用这些选项。 Here is my code: 这是我的代码:

#!/bin/bash -eo pipefail
IN=$(git diff-tree --no-commit-id --name-only -r HEAD)
OUT=$(echo $IN | tr ";" "\n")
for file in "${OUT[@]}"; do
    ncftpput -bb -S .tmp -v -u "zeussite@kolechia.heliohost.org" -p "*****" ftp.kolechia.heliohost.org "/" $file
done
ncftpbatch

As you can see, I need the -S .tmp to avoid breaking the site during uploads. 如您所见,我需要-S .tmp以避免在上传过程中破坏站点。 -v provides output to prevent my CI service from timing out. -v提供输出以防止我的CI服务超时。

How can I upload only the changed files - without temporarily breaking the site? 如何仅上传更改的文件-而不临时中断网站? I'm thinking of just logging in separately for each file, but that is bad practice. 我正在考虑只为每个文件分别登录,但这是不好的做法。

Why not launch a function in background which just prints dummy values like uploading, please wait and then sleeps for few seconds and do it again. 为什么不在后台启动仅打印伪值( uploading, please wait ,然后休眠几秒钟,然后再次执行。 Outside the loop you can kill that background job 在循环之外,您可以杀死该后台作业

If you don't want any output 如果你不想要任何输出

printf "\0" 

or 要么

printf "a\b"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM