[linux]Running sftp automatically by expect tools

2023-8-27 写技术

#!/usr/bin/expect -f
send "mv ./models/weights/FCRNet.weights.h5 ./models/weights/FCRNet.weights.h5.back\r"
expect "*python39*"
spawn sftp -P 3222 root@log.anycle.com
expect "*assword"
send "dppppppppppasdas\r"
expect "sftp>"
set timeout -1
send "get /hy-tmp/FCRN/models/weights/FCRNet.weights.h5 ./models/weights/FCRNet.weights.h5\r"
expect "sftp>"
send "exit\r"
expect "*python39*"
set timeout -1
spawn python eval.py preprocess
expect "*python39*"
set timeout -1
spawn python eval.py pre
expect "*python39*"
expect eof

标签: linux

发表评论:

Powered by anycle 湘ICP备15001973号-1