gpt4 book ai didi

linux - ftp mput 仅发送四个文件 - ubuntu

转载 作者:太空宇宙 更新时间:2023-11-04 04:23:49 25 4
gpt4 key购买 nike

我编写了一个 bash 脚本,并在 ubuntu 12.04 中使用 cron 每分钟运行它。

在下面您可以看到我的 ftp 上传脚本:

#!/bin/sh 
HOST='192.168.10.40'
USER='user1'
PASSWD='Oo123456'
FILE='CAM_1_*'
DIR='SecImg'
UP='..'
cd /home/user1/Masaüstü/BBTCP/
chmod 777 $FILE
ftp -v -n $HOST <<__END_OF_SESSION
user $USER $PASSWD
type binary
cd $DIR
mput $FILE
cd $UP
bye
__END_OF_SESSION

该目录中有 10 个不同的文件,其名称格式为 CAM_1_IP_EPOCH.jpg

例如

CAM_1_192.168.10.30_12345678.jpg

CAM_1_192.168.10.30_12345688.jpg

CAM_1_192.168.10.30_12345698.jpg

...

CAM_1_192.168.10.30_12345878.jpg

但是 mput 只发送 4 个文件。如何通过 ftp 发送所有文件。

当我尝试发送到这里时,输出是:

这是输出:

Connected to 192.168.10.40.
220-FileZilla Server version 0.9.41 beta
220-written by Tim Kosse (Tim.Kosse@gmx.de)
220 Please visit http://sourceforge.net/projects/filezilla/
331 Password required for ozen.ozkaya
230 Logged on
Remote system type is UNIX.
?Invalid command
200 Type set to I
250 CWD successful. "/SecImg" is current directory.
mput CAM_1_192.168.10.33_1339750625.jpg? 200 Port command successful
150 Opening data channel for file transfer.
226 Transfer OK
14682 bytes sent in 0.00 secs (5206.2 kB/s)
mput CAM_1_192.168.10.33_1339750628.jpg? 200 Port command successful
150 Opening data channel for file transfer.
226 Transfer OK
14636 bytes sent in 0.00 secs (4809.2 kB/s)
mput CAM_1_192.168.10.33_1339750631.jpg? 200 Port command successful
150 Opening data channel for file transfer.
226 Transfer OK
14872 bytes sent in 0.00 secs (5260.2 kB/s)
mput CAM_1_192.168.10.33_1339750635.jpg? 200 Port command successful
150 Opening data channel for file transfer.
226 Transfer OK
14569 bytes sent in 0.00 secs (4850.8 kB/s)
mput CAM_1_192.168.10.33_1339750638.jpg? mput CAM_1_192.168.10.33_1339750640.jpg? mput CAM_1_192.168.10.33_1339750644.jpg? mput CAM_1_192.168.10.33_1339750647.jpg? mput CAM_1_192.168.10.33_1339750650.jpg? mput CAM_1_192.168.10.33_1339750654.jpg? mput CAM_1_192.168.10.33_1339750658.jpg? mput CAM_1_192.168.10.33_1339750660.jpg? mput CAM_1_192.168.10.33_1339750694.jpg? mput CAM_1_192.168.10.33_1339750696.jpg? mput CAM_1_192.168.10.33_1339750699.jpg? mput CAM_1_192.168.10.33_1339750703.jpg? mput CAM_1_192.168.10.33_1339750706.jpg? mput CAM_1_192.168.10.33_1339750709.jpg? mput CAM_1_192.168.10.33_1339750713.jpg? mput CAM_1_192.168.10.33_1339750716.jpg? mput CAM_1_192.168.10.33_1339750719.jpg? mput CAM_1_192.168.10.33_1339750723.jpg? 221 Goodbye

它只发送前四个,不能发送其余的...

问候

最佳答案

我怀疑发生的情况是 bash 将 FILE='CAM_1_*' 扩展为本地系统上的完整文件列表,然后 mput 命令行太长而无法处理所有文件。

尝试在设置 FILE 后添加“echo ${FILE}”行以查看变量的值。

如果发生这种情况,请在设置 FILE 之前添加“set -f”命令以禁用文件名扩展。

关于linux - ftp mput 仅发送四个文件 - ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10946280/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com