差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
it:server:file_sync [2022-08-02 16:32] – [rsync 监控目录并同步] goldentianyait:server:file_sync [2022-08-29 18:45] (当前版本) goldentianya
行 40: 行 40:
 [[http://xstarcd.github.io/wiki/shell/expect_handbook.html|expect 中文教程]] / [[http://xstarcd.github.io/wiki/shell/expect.html|expect 自动交互脚本]] [[http://xstarcd.github.io/wiki/shell/expect_handbook.html|expect 中文教程]] / [[http://xstarcd.github.io/wiki/shell/expect.html|expect 自动交互脚本]]
 <code> <code>
- +apt-get install expect -y
-yum install -y expect +
 </code> </code>
  
 脚本 "deploy.exp" 文件 脚本 "deploy.exp" 文件
  
-<file sh dodeploy.sh>+<file dodeploy.sh>
 #!/usr/bin/expect #!/usr/bin/expect
 spawn scp -r ./libs ./resources ./dist index.js app.js jobs.js package.json <username>@<host_ip|name>:/destination_path spawn scp -r ./libs ./resources ./dist index.js app.js jobs.js package.json <username>@<host_ip|name>:/destination_path
行 59: 行 57:
 然后执行脚本文件 ''expect path_to/deploy.exp'' 然后执行脚本文件 ''expect path_to/deploy.exp''
  
 +如果希望执行以后继续留在进程内,比如 “su -” 更换root用户,需要将 exp_continue 换成 <color #ff7f27>''%%interact%%''</color>
  
 {{tag>shell vps 文件系统}} {{tag>shell vps 文件系统}}
it/server/file_sync.1659457954.txt.gz · 最后更改: 2022-08-02 16:32 由 goldentianya
回到顶部
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0