用python执行shell脚本,奇数分钟执行
from datetime import date, datetime, timedelta from time import clock as now import commands import decimal import urllib2 import json import datetime import time min = time.strftime('%M', time.localtime()) m = int(min) command_start = "test" command_stop = "stop" if m % 2 == 0: a, b = commands.getstatusoutput(command_start) print 'start ', a else: a, b = commands.getstatusoutput(command_stop) print 'stop ', a