首页 > 其他 > 详细

时间同步脚本

时间:2018-06-28 16:40:27      阅读:213      评论:0      收藏:0      [点我收藏+]
#!/usr/bin/env python #coding:utf-8 #Example: #阿里云同步 #ntpd -u ntp:ntp -p /var/run/ntpd.pid -g #ntpdate time.nist.gov time.nuri.net 0.asia.pool.ntp.org 1.asia.pool.ntp.org 2.asia.pool.ntp.org 3.asia.pool.ntp.org import os command = [‘ntpdate time.nist.gov‘, ‘rm -rf /etc/localtime‘, ‘ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime‘, ‘hwclock -w‘, "export TZ=‘Asia/Shanghai‘", ‘echo "export TZ=\‘Asia/Shanghai\‘" >> /root/.bashrc‘] for com in command: os.system(com)

时间同步脚本

原文:http://blog.51cto.com/yht1990/2133763

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!