shell 下sftp 自动上传文件的脚本

#!/bin/sh
export HOST=myhost;
export USER=backup;
export PASS=******;
export xxx=filename
echo "sftp start";
lftp -u ${USER},${PASS} sftp://${HOST} <<EOF
cd /home/backup
put /home/stuff/${xxx}.txt
bye
EOF
echo "done";

Written by gegewan on 三月 18th, 2009 with no comments.
Read more articles on FreeBSD/Linux.

Related articles

No comments

There are still no comments on this article.

Leave your comment...

If you want to leave your comment on this article, simply fill out the next form:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .