【发布时间】:2014-04-18 20:19:22
【问题描述】:
我在 Linux 上使用 bash shell ...
$ uname -a
Linux sandbox.mydomain.com 3.4.76-65.111.amzn1.x86_64 #1 SMP Tue Jan 14 21:06:49 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
虽然如果我能在任何支持 bash 的环境中提出解决方案,那就太好了。我的问题是,在我的脚本中,我想在 5 秒内安排延迟重启我的服务器。到目前为止,我有以下,但需要 60 秒......
# Timed reboot of server
sudo shutdown -r 1
# Fail if any of the sub-deployments failed.
if [[ ( $PROC1_STATUS -ne 0 ) ||
( $PROC2_STATUS -ne 0 ) ||
( $PROC3_STATUS -ne 0 ) ]]
then
exit 1;
fi
除了在 5 秒而不是 1 分钟内定时重启之外,有谁知道我可以如何调整上述内容?该解决方案不必使用“关闭”,但它是我能找到的唯一工具。
- 戴夫
【问题讨论】: