python开发时间同步脚本-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

python开发时间同步脚本

#!/usr/bin/env python
#coding:utf-8

#Example:
#ntpdate -u 0.asia.pool.ntp.org 1.asia.pool.ntp.org 2.asia.pool.ntp.org 3.asia.pool.ntp.org cn.ntp.org.cn  time.nuri.net 

import os
command = ['ntpdate cn.ntp.org.cn',
           '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)  

分享标题:python开发时间同步脚本
网站地址:http://kswsj.cn/article/gcjhcd.html

其他资讯