CentOS ntp time synchronization
Recently I discovered that the time on my centos machine is wrong at intervals, which is very unfriendly for me who regularly checks logs.
1. Install NTP time synchronization service.
yum install ntp -y
2. Automatically synchronize with Alibaba Cloud time server
ntpdate ntpdate ntp1.aliyun.com
3. Create a scheduled task and set it to synchronize every half hour
vim /etc/crontab
*/30 * * * * ntpdate ntp1.aliyun.com