整理了Linux下上传文件至FTP的函数,将变量部分替换成实际的名称。https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
https://www.cndba.cn/hbhe0316/article/4779
putCheckLogtoFtp(){
ping -c 3 -w 3 $FtpServerIp > /dev/null
if [[ $? == 0 ]];then
which ftp > /dev/null 2>&1
if [[ $? == 0 ]];then
ftp -n<<!
open $FtpServerIp
user $FtpUser $FtpUserPassword
binary
cd /home/ftpuser
lcd /tmp/log
prompt
put $CheckLinuxLog
close
bye
!
else
echo "Current OS does not have ftp command." >> $CheckLinuxLogPath/$CheckLinuxLog
fi
else
echo "Can't Ping $FtpServerIp,check failed." >> $CheckLinuxLogPath/$CheckLinuxLog
fi
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
linux