经常要部署多台服务器上面的应用,如果一个个机器的登录太麻烦. 所有就想到编写一个脚本来部署不同的服务器 前提条件: 配置ssh免登陆 如果不会的请参加我的另外一篇文章 http://blog.csdn.net/chenpy/article/details/30281515 两个错误: Pseudo-terminal will not be allocated because stdin is not a terminal.使用ssh -t -t 可以解决 另外一个问题Agent admitted
man cd -->查询不到,所以会提示bash的内置命令 . alias bg bind break builtin caller cd command compgen complete compopt continue declare dirs disown echo enable eval exec exit export false fc fg getopts hash help history jobs kill let local logout mapfile popd print
Write a service file and place it in /etc/systemd/system/beforeshuttingdown.service code: [Unit] Description=Run mycommand at shutdown Requires=network.target DefaultDependencies=no Before=shutdown.target reboot.target [Service] Type=oneshot RemainAf