import os import time git = '06:00:00' def got(): import time time = time.strftime('%T') #print(time) if time == git: os.system('./git.sh') print('已经完成今天的备份,时间是:',time) while True: time.sleep(1) got()