test

2021/6/11 18:55:42

本文主要是介绍test,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

#! /usr/bin/env python
import os,sys
import time

def main():
    url_dnsrbl3=r'curl -connect-timeout 100 -m 900 -X GET https://dgarchive.caad.fkie.fraunhofer.de/today/3/dnsrbl -u yd0str:soapdoorwivettlcamweir >'
    url_today=r'curl -connect-timeout 10 -m 900 -X GET https://dgarchive.caad.fkie.fraunhofer.de/today -u yd0str:soapdoorwivettlcamweir >'
    url_dnsrbl=r'curl -connect-timeout 10 -m 900 -X GET https://dgarchive.caad.fkie.fraunhofer.de/today/dnsrbl -u yd0str:soapdoorwivettlcamweir >'
    nowtime=time.strftime('%Y-%m-%d',time.localtime())
    #updatetime=time.strftime('%H:%M:%S',time.localtime())
    updatetime=r'08:18:08'
    print updatetime
    if not os.path.exists(r'/home/w131/yd/dga_data_analysis/dga_family_path/dgarchive_domain/'):
        os.mkdir('/home/w131/yd/dga_data_analysis/dga_family_path/dgarchive_domain/')
    out_dnsrbl3=nowtime+'_dnsrbl_3'
    out_today=nowtime+'_today'
    out_dnsrbl=nowtime+'_dnsrbl'
    os.system("%s %s" % (url_dnsrbl3,r'/home/w131/yd/dga_data_analysis/dga_family_path/dgarchive_domain/'+out_dnsrbl3))
    os.system("%s %s" % (url_today,r'/home/w131/yd/dga_data_analysis/dga_family_path/dgarchive_domain/'+out_today))
    os.system("%s %s" % (url_dnsrbl,r'/home/w131/yd/dga_data_analysis/dga_family_path/dgarchive_domain/'+out_dnsrbl))
    if sys.argv[1]=="t":
        while 1:
            if updatetime==time.strftime('%H:%M:%S',time.localtime()):
                nowtime=time.strftime('%Y-%m-%d',time.localtime())
                out_dnsrbl3=nowtime+'_dnsrbl_3'
                out_today=nowtime+'_today'
                out_dnsrbl=nowtime+'_dnsrbl'
                os.system("%s %s" % (url_dnsrbl3,r'/home/w131/yd/dga_data_analysis/dga_family_path/dgarchive_domain/'+out_dnsrbl3))
                os.system("%s %s" % (url_today,r'/home/w131/yd/dga_data_analysis/dga_family_path/dgarchive_domain/'+out_today))
                os.system("%s %s" % (url_dnsrbl,r'/home/w131/yd/dga_data_analysis/dga_family_path/dgarchive_domain/'+out_dnsrbl))
                time.sleep(86000)
if __name__=='__main__':
    main()

  



这篇关于test的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程