Skip to content
Snippets Groups Projects
Commit ea872719 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

cleaner.py

parent 5d2e11ae
No related branches found
No related tags found
No related merge requests found
import communication
import subprocess
import asyncio
local = communication.DownloadServer()
def disk_useage_pcent():
p = subprocess.run(["df", ".", "--output=pcent", "--sync"], stdout=subprocess.PIPE, encoding="utf-8", check=True)
return int(p.stdout.split("\n")[1].split("%")[0])
async def main():
while True:
usage = disk_useage_pcent()
if usage <= 94: break
print(f"Disk usage too high ({usage}%)")
first_realtime = await local.list_next_realtime_data(communication.dt_minf)
print("REMOVE", first_realtime)
await local.remove_data(first_realtime)
asyncio.run(main())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment