#!/bin/bash
( echo "connect -u ${username},${password} sftp://${IP}:${Port}"
echo "cd ${remote_path}"
echo "lcd ${local_path}"
echo "mirror --parallel=3 ${sync_path_name}"
echo "bye")|lftp
#相关变量可以换成实际的
服务器信息,也可以从单独的配置文件中获取相关信息
网页名称:shell脚本-通过lftp同步远端目录到本地
标题网址:
http://cqcxhl.com/article/jcpgjs.html