Skip to content

Commit 2403417

Browse files
authored
fix: check number of wiki backup files on dropbox (#143)
Signed-off-by: Shikhar <[email protected]>
1 parent 8a1d4dd commit 2403417

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

jobs/backup/rotate_backups.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@
3333
has_more_files = result.has_more
3434
files.extend(result.entries)
3535

36-
print("Starting rotation")
37-
number_of_files = len(files)
3836
for file in files:
3937
if file.name.find("metakgp_wiki") == -1:
40-
continue
38+
files.remove(file)
39+
40+
number_of_files = len(files)
41+
print(f"{number_of_files} backup files found.")
42+
43+
print("Starting rotation")
44+
for file in files:
4145
file_timestamp = file.client_modified
4246
days_old = (now - file_timestamp).days
4347
if days_old > 30 and (number_of_files - counter) > 30:

0 commit comments

Comments
 (0)