ubuntu20.04时区设置为上海
作者:互联网
将系统时间设置为时区为上海,24小时制方便查看日志,cron保证集群时间同步。
apt install chrony -y
systemctl status chrony
systemctl enable --now chrony
find / -name Shanghai
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
echo "LC_TIME=en_DK.UTF-8" >> /etc/default/locale
apt install ntpdate -y
ntpdate time1.aliyun.com
echo "*/5 * * * * ntpdate time1.aliyun.com &> /dev/null && hwclock -w" >> /var/spool/cron/crontabs/root
reboot
个人网站:https://cxupup.com
标签:ubuntu20.04,ntpdate,Shanghai,apt,echo,chrony,设置,时区,com 来源: https://www.cnblogs.com/cxupup/p/16201255.html