bash脚本在一个脚本中的screen命令后运行作业

时间:2015-08-20 01:20:53

标签: bash ssh sftp gnu-screen ssh-tunnel

这就是我想要做的事情:

#!/bin/bash

# start the tunnel
ssh tunnel@hostA -L 6000:hostB:22 -N
# this is the problem, i need to go next process after tunnel on

# Main proses that i must run under tunnel command
sftp -oPort=6000 user@localhost:/home/you <<GETME
lcd /home/me/temp
get *.tar
bye
GETME
echo " Job Done"

# i hope it can be add
# kill the tunnel after sftp done

现在我使用2个putty来运行sftp到hostB,我想也许可以在一个单独的脚本中完成

0 个答案:

没有答案