#!/bin/shhost=xxx.xxx.xxx.xxxuser=xxxpass=xxxlocaldir=/xxx/xxxremotedir=/xxx/xxxfilename=xxxftp -i -n $host <user $user $passcd $remotedirlcd $localdirappend $filenamequitEOF
运行命令 nohup ./upload.sh > upload.log 2>&1 &
编写一个脚本文件 upload.cfg,里面直接写ftp命令
open xxx.xxx.xxx.xxxuser xxx xxxcd xxxlcd xxxput xxxquit
运行命令 lftp -f upload.cfg
。缺点是,似乎不支持append断点续传
host=xxx.xxx.xxx.xxxuser=xxxpass=xxx
然后运行命令 ncftpput -f login.cfg -z remote_dir local_dir/file
。缺点是,似乎也不支持断点续传(本来有一个-z的参数,但是好像不好用)
假设远程机器和本地用户都是jack 首先用ssh-keygen在远程机器上生成一个密钥,密码为空. 然后把远程机器上的/home/jack/.ssh/id_rsa.pub文件内容复制到本地机器上的/home/jack/.ssh/authorized_keys 里面 这样再用ssh登录的时候就不用密码了
做好这个之后,可以用 scp filename jack@remote_host
上传。缺点是,不支持断点续传,不支持后台运行...似乎是个垃圾解决方案,不过倒是支持加密,嗯