Shell上传zip压缩文件到FTP服务器 Shell脚本实现上传zip压缩文件到FTP服务器

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

Shell上传zip压缩文件到FTP服务器 Shell脚本实现上传zip压缩文件到FTP服务器

  2021-03-19 我要评论
想了解Shell脚本实现上传zip压缩文件到FTP服务器的相关内容吗,在本文为您仔细讲解Shell上传zip压缩文件到FTP服务器的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:Shell脚本,上传zip压缩文件,FTP服务器,下面大家一起来学习吧。

复制代码 代码如下:

# /bin/bash
# creator:lihuibin
# date : 2014-03-10 16:45
# desc : upload file to ftp
hosts="192.168.56.100"
port=21
user=test
pass=testpwd
work_path="/var/www/cms"
packname="publish"
#hosts=$1
#port=$2
#user=$3
#pass=$4
#packname=$6
#work_path=$5
cd $work_path
/usr/bin/zip -r $packname *
[ -f "$work_path/$packname" ] &&{
ftp -n<<!
open $hosts $port
type binary
user $user $pass
cd /upload
lcd $work_path
prompt
put $packname
close
bye
!
rm -f $packname
}

猜您喜欢

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们