这是本文档旧的修订版!


与服务器文件同步

监控目录并同步

scp 脚本命令


scp -r ./libs ./resources ./dist ./*.js ./*.json [email protected]:/home/ubuntu/apis

使用 expect 交互命令

expect 中文教程 / expect 自动交互脚本


yum install -y expect

脚本 “deploy.exp” 文件

dodeploy.sh
#!/usr/bin/expect
spawn scp -r ./libs ./resources ./dist index.js app.js jobs.js package.json <username>@<host_ip|name>:/destination_path
set pass "*******"
expect {
password: {send "$pass\r"; exp_continue}
}

然后执行脚本文件 expect path_to/deploy.exp

it/server/file_sync.1626795298.txt.gz · 最后更改: 2021-07-20 15:34 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0