• 时间定时同步


    时间定时同步

    1.查看时区:timedatectl
    2.将硬件时钟调整为与本地时钟一致, 0 为设置为 UTC 时间:timedatectl set-local-rtc 1
    
    timedatectl set-timezone Asia/Shanghai 设置系统时区为上海
    3.timedatectl set-ntp no
    4.timedatectl set-time '2021-01-11 10:00:00'
    5.clock -w
    timedatectl set-local-rtc 1
    
    cd /etc/sysconfig/network-scripts
    vi ifcfg-eth0
    
    
    DNS2=172.20.7.9
    echo "DNS2=172.20.7.9" >>/etc/sysconfig/network-scripts/ifcfg-eth0
    cat /etc/sysconfig/network-scripts/ifcfg-eth0
    systemctl restart network
    ping ntp.zjhu.edu.cn
    
    yum -y install crontabs
    systemctl start crond.service
    systemctl enable crond.service
    systemctl status  crond.service
    
    crontab -e
    0 */2 * * * ntpdate ntp.zjhu.edu.cn
    */1 * * * * /sbin/ntpdate ntp.zjhu.edu.cn
    
    /sbin/ntpdate ntp.zjhu.edu.cn
    
    
    yum install -y ntpdate
    systemctl start ntpdate.service
    systemctl status ntpdate.service
    systemctl enable ntpdate.service
    
    find / -name CentOS-7.6-x86_64-DVD-1810.iso
    mount -o loop  /u01/CentOS-7.6-x86_64-DVD-1810.iso   /mnt
    mount -o loop  /u01/bak/CentOS-7.6-x86_64-DVD-1810.iso   /mnt
    
    mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/
    
    echo "[base]" >> /etc/yum.repos.d/123.repo
    echo "name=123" >> /etc/yum.repos.d/123.repo
    echo "baseurl=file:///mnt" >> /etc/yum.repos.d/123.repo
    echo "gpgcheck=0" >> /etc/yum.repos.d/123.repo
    echo "enable=1" >> /etc/yum.repos.d/123.repo
    
    yum makecache
    
  • 相关阅读:
    CyclicBarrier与CountDownLatch区别
    导入搜狗实验室新闻语料库
    安装ik分词插件
    分页显示时传递页码的方法
    elasticsearch安装步骤
    linux查看端口占用情况
    Python:文件的读取、创建、追加、删除、清空
    R语言-选择样本数量
    不符合正态分布的配对数据也有自己的统计方法。
    python时间处理
  • 原文地址:https://www.cnblogs.com/khtt/p/15223625.html
Copyright © 2020-2023  润新知