当前位置: > shell编程 >

linux下lftp同步上传文件到ftp的shell脚本

时间:2014-09-30 22:43来源:linux.it.net.cn 作者:it
用lftp命令同步上传文件到ftp的一个脚本。

lftp命令同步上传文件,代码如下:
 

复制代码代码示例:
#!/bin/bash

HOST="IP:端口"
USER="用户名"
PASS="密码"
LCD="本地路径"
RCD="远程路径"
lftp -c "set ftp:list-options -a;
open ftp://$USER:$PASS@$HOST;
lcd $LCD;
cd $RCD;
mirror --reverse \
       --verbose \
       --exclude-glob a-dir-to-exclude/ \
       --exclude-glob a-file-to-exclude \
       --exclude-glob a-file-group-to-exclude* \
       --exclude-glob other-files-to-esclude"
 
 
(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容