我正在为我的Linux服务器编写一个更新/重新启动的剧本,并且我希望确保只有当另一个主机在同一个剧本中运行时,任务才会被执行。例如:- hosts: project-live-app01 - name: stop app before rebootingthe machine with all defaults post_reboot_delay: 20
我正在尝试在服务器上执行脚本。当我执行crontab -l时,我在终端上得到了@reboot cd my_project_path; ./start.sh。然而,当我执行@reboot cd my_project_path; ./start.sh时,我得到了-bash: @reboot: command not found。如何在bash中包含reboot命令?抱歉,如果这是一个非常基本的问题,但我不是bash的大师。
下面的ansible代码意思是退出并发送当机器是prod服务器时我们无法重新启动的消息hostname
server109.lab.domain.com- name: exit if reboot needed msg:after kernel update need reboot but reboot wi