Closed MatsAndT closed 4 years ago
pi@raspberrypi:~/AstroPi/astro-memory $ du -sh data
3.5G data
It is the folder where the images and DB is stored, this should be less than 3 GB.
pi@raspberrypi:~/AstroPi/astro-memory $ du -sh data/database.sqlite
116K data/database.sqlite
Code for this issue, see Space-not-left-fix-#32
>>> os.path.getsize("./data/imgs/")
36864
>>> os.path.getsize("./data/")
4096
>>> os.path.getsize("./data/imgs/"+"../")
4096
https://gist.github.com/SteveClement/3755572
import os
def get_size(start_path = '.'):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)
##total_size += os.path.getsize(fp)
total_size += (os.path.getsize(fp) if os.path.isfile(fp) else 0)
return total_size
print get_size()
# determine size of a given folder in MBytes
import os
# pick a folder you have ...
folder = 'D:\\zz1'
folder_size = 0
for (path, dirs, files) in os.walk(folder):
for file in files:
filename = os.path.join(path, file)
folder_size += os.path.getsize(filename)
print "Folder = %0.1f MB" % (folder_size/(1024*1024.0))
or https://stackoverflow.com/a/1392549/7419883
import os
sum(os.path.getsize(f) for f in os.listdir('.') if os.path.isfile(f))
2019
from pathlib import Path
root_directory = Path('.')
sum(f.stat().st_size for f in root_directory.glob('**/*') if f.is_file() )
Commit is unrelated to this issue
Terminal Error
It was like the img did not have a id
Log Error / Log
The issue could be that the sd card is too small and not the data have existed 3 GB.