用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" |