# help="The list of the file name, this option could be specified several times") options, args = parser.parse_args() host = options.host port = options.port user = options.user password = options.password directory = options.directory day = options.day if host is None or port is None or user is None or password is None or directory is None or day is None: parser.print_help() sys.exit(0) load_domain_suffix() ad_map = DbUtil.get_ad_info() logging.info("read ad info finished, length: %d" % len(ad_map)) city_provice_map = DbUtil.get_city_info() logging.info("read city province info finished, length: %d" % len(city_provice_map)) directory = directory.rstrip(os.sep) t = threading.Thread(target=timer_func, args=(30, )) t.start() t2 = threading.Thread(target=flush_func, args=(30, host, port, user, password)) t2.start() for hour in range(0, 24, 1):