Fix download syslog

pull/3/head
remittor 3 years ago
parent 7f21e1b086
commit f40af2cea1

@ -28,7 +28,6 @@ print("File {} created!".format(fn_remote))
print("Downloading data to a computer...")
gw.download(fn_remote, fn_local)
#print("Удаляю временные файлы")
gw.run_cmd("rm -f " + fn_remote)
with open(fn_local, "r") as file:
@ -45,12 +44,15 @@ if os.path.exists(fn_local):
if os.path.exists(fn_old):
os.remove(fn_old)
os.rename(fn_local, fn_old)
#gw.run_cmd("cat /data/usr/log/messages > " + fn_remote)
gw.run_cmd("cat /proc/xiaoqiang/xq_syslog > " + fn_remote)
gw.run_cmd("cat /data/usr/log/messages /tmp/messages > " + fn_remote)
#gw.run_cmd("cat /proc/xiaoqiang/xq_syslog > " + fn_remote)
gw.download(fn_remote, fn_local)
gw.run_cmd("rm -f " + fn_remote)
with open(fn_local, "r") as file:
data = file.read()
with open(fn_local, "w") as file:
file.write(data)
print("System logs are written to a file {}".format(fn_local))

Loading…
Cancel
Save