Small adjustments for csv export

This commit is contained in:
Simon 2018-06-19 10:01:15 -04:00
parent e5e38a6faf
commit 4f5f0f76be
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ def export(outfile="out.csv"):
docs = es.stream_all_docs()
docs_with_website = db.join_website_on_scan(docs)
print("Connected")
print("Connected, writing to csv")
with open(outfile + ".temp", "w") as out:
@ -29,7 +29,7 @@ def export(outfile="out.csv"):
doc["_source"]["mtime"]])
print("Wrote to csv, compressing with xz")
os.system("xz " + outfile + ".temp")
os.system("xz -0 " + outfile + ".temp")
os.system("mv " + outfile + ".temp.xz " + outfile + ".xz")
print("Compressed to " + str(os.path.getsize(outfile + ".xz")) + " bytes")

View File

@ -8,7 +8,7 @@
<div class="card-header">Downloads</div>
<div class="card-body">
<p>The entire database is exported to CSV every ±30min</p>
<p>The entire database is exported to CSV regularly</p>
<table class="table table-striped">
@ -25,7 +25,7 @@
<tr>
<td><a href="/get_export">out.csv.xz</a></td>
<td>{{ export_file_stats.st_size |filesizeformat }}</td>
<td>{{ export_file_stats.st_mtime|date_format }}</td>
<td>{{ export_file_stats.st_mtime|datetime_format }}</td>
</tr>
{% endif %}
</tbody>