Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux ftp mput只发送四个文件-ubuntu_Linux_Bash_Ftp - Fatal编程技术网

Linux ftp mput只发送四个文件-ubuntu

Linux ftp mput只发送四个文件-ubuntu,linux,bash,ftp,Linux,Bash,Ftp,我写了一个bash脚本,并在ubuntu12.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_SESSIO

我写了一个bash脚本,并在ubuntu12.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
它只发送前四个,不能发送其余的


关于

我怀疑发生的情况是bash正在将文件class='CAM_1\*'扩展到本地系统上的完整文件列表中,然后mput命令行太长,无法处理所有文件

在设置FILE之后,尝试添加一个'echo${FILE}行,以查看变量的值


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

它可以找到文件,但无法发送。我将输出添加到问题:远程系统上是否已经存在未连接的文件,可能具有文件权限或所有权,从而防止ftp覆盖这些文件?此外,您可能希望尝试在ftp调用中包含“-i”标志,以在多个文件传输期间关闭交互式提示。另外,“type binary”周围的“?Invalid Command”输出看起来很奇怪。也许试试“二进制”。
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