【运维】修改服务器时间bash脚本
由于有需要,要对服务器时间进行固定回退,因此编写该脚本。其中需要先安装ntpdate来通过网络更新时间。yum install -y ntpdate最终编写脚本如下。#!/bin/bashecho "license updated start"# 使用上海的时间同步服务器ntpdate ntp.api.bzhwclock --systohctime=$(date "+%H:%M:%S")date -s "2021-8-9 $time"hwclock --systohcec