提取.py:
def extract_lz4(lz4_path):
status = subprocess.call(["lz4", "-df", lz4_path], stderr=subprocess.STDOUT)
log.info("In Extract fun STATUS : {}".format(status))
if not status:
log.info("Extract Successful of {}".format(lz4_path))
return status
else:
log.info("Extract Successful of {}".format(lz4_path))
return status
主要.py:
lz4_file = '<path-to-lz4-file>/ly486imc83e0v9a7-23-telnet-banner-full_ipv4-20180515T040003-zmap-results.csv.lz4'
extract_status = extract_lz4_task(lz4_file)
log.info("extract_status : {}".format(extract_status))
当我调用主文件时,python <path-to-file>/main.py
它将成功提取。但是当我把它放在 crontab 中时,它不会提取.
crontab -e:
* * * * * python <path-to-file>/main.py
有什么我想念的吗?任何帮助将不胜感激