Skip to main content

米斯特周

Tag: Lftp

使用lftp与sftp获取远端文件脚本

因为工作的原因,需要每日使用sftp获取远程主机上的文件,所以就在想能不能脚本化,这样就不用天天定时定点的在服务器前面守着了。

lftp是linux下面的一个ftp客户端工具,使用起来非常方便,它的参数如下:

[zhou@localhost ~]$ lftp -h
Usage: lftp [OPTS] <site>
`lftp' is the first command executed by lftp after rc files
 -f <file>           execute commands from the file and exit
 -c <cmd>            execute the commands and exit
 --help              print this help and exit
 --version           print lftp version and exit
Other options are the same as in `open' command
 -e <cmd>            execute the command just after selecting
 -u <user>[,<pass>]  use the user/password for authentication
 -p <port>           use the port for connection
 <site>              host name, URL or bookmark name