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开发时间同步脚本
网页URL:http://kswjz.com/article/gcjhcd.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流