简体   繁体   English

ftp mput仅发送四个文件-Ubuntu

[英]ftp mput sends only four file - ubuntu

I wrote a bash script and i am running it with cron in ubuntu 12.04 for every minute. 我写了一个bash脚本,并且每分钟都在ubuntu 12.04中使用cron运行它。

Here below you can see my ftp upload script: 在下面,您可以看到我的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

In the directory there are 10 different files named in the format CAM_1_IP_EPOCH.jpg 在该目录中,有10个不同的文件,格式为CAM_1_IP_EPOCH.jpg

For example 例如

CAM_1_192.168.10.30_12345678.jpg CAM_1_192.168.10.30_12345678.jpg

CAM_1_192.168.10.30_12345688.jpg CAM_1_192.168.10.30_12345688.jpg

CAM_1_192.168.10.30_12345698.jpg CAM_1_192.168.10.30_12345698.jpg

... ...

CAM_1_192.168.10.30_12345878.jpg CAM_1_192.168.10.30_12345878.jpg

But mput only sends 4 files. 但是mput只发送4个文件。 How can I send all files over ftp. 如何通过ftp发送所有文件。

When I try to send here is the output: 当我尝试发送到这里是输出:

Here is the output: 这是输出:

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

It only sends first four and can not send the rest... 它只发送前四个,不能发送其余的...

Regards 问候

I suspect what's happening is bash is expanding the FILE='CAM_1_*' into a full list of files on your local system, and then the mput command line is too long to process all the files. 我怀疑bash正在将FILE ='CAM_1_ *'扩展为本地系统上文件的完整列表,然后mput命令行太长,无法处理所有文件。

Try adding an 'echo ${FILE} line after setting FILE to see what value the variable has. 设置FILE后,尝试添加'echo $ {FILE}行,以查看变量具有的值。

If this is happening, then add a 'set -f' command before setting FILE to disable the filename expansion. 如果发生这种情况,请在设置FILE禁用文件名扩展之前添加'set -f'命令。

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

相关问题 如何保留使用 /usr/bin/ftp 上传(mput)的文件的时间戳? - How can I preserve the timestamp of a file that I upload (mput) with /usr/bin/ftp? mput 在 FTP 传输期间不传输所有文件 - mput Not Transferring All Files During FTP Transfer 如何使用该Ubuntu服务器自动/定期将文件从FTP服务器复制到其他Ubuntu服务器? - How can I automatically/periodically copy a file from an FTP server to a different Ubuntu server, using that Ubuntu server? ftp&#39;put file * .txt&#39;的行为-仅上传第一个匹配的文件 - Behaviour of ftp 'put file*.txt' - Uploading the first matching file only 内部服务器错误500仅在通过ftp传输的文件上,而不在本地创建的文件上运行,运行ubuntu服务器16.04 - internal server error 500 only on files transferred over ftp not on locally created files, running ubuntu server 16.04 在 ftp 中只能看到目录但看不到文件(使用 VSFTPD) - Can only see directories but no file in ftp (using VSFTPD) Ubuntu Crontab无法运行FTP - Ubuntu Crontab to run FTP is not working 需要帮助来解决Ubuntu Linux上的FTP问题 - Need help troubleshooting FTP problem on Ubuntu Linux 使用输入文件和ftp进行循环 - For loop with input file and ftp 谁在ubuntu服务器上神秘地发送了一个SIGKILL到我的进程 - Who sends a SIGKILL to my process mysteriously on ubuntu server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM