This check is not reliable. Sometimes in-progress logs are not a
multiple of the block size.
-BLOCK_SIZE = 4096
-MIN_AGE = time.time() - 86400 * 7
+MIN_AGE = time.time() - 86400 * 1
def removesuffix(s, suf): # Until python 3.9
def removesuffix(s, suf): # Until python 3.9
for f in files:
path = os.path.join(d, f)
st = os.stat(path)
for f in files:
path = os.path.join(d, f)
st = os.stat(path)
- if (st.st_size % BLOCK_SIZE) == 0 and st.st_mtime > MIN_AGE and truncated(path):
+ if st.st_mtime > MIN_AGE and truncated(path):
print(d[-2:] + removesuffix(f, '.bz2'))
print(d[-2:] + removesuffix(f, '.bz2'))