Skip to content

Commit

Permalink
fix: check number of wiki backup files on dropbox (#143)
Browse files Browse the repository at this point in the history
Signed-off-by: Shikhar <shikharish05@gmail.com>
  • Loading branch information
shikharish committed Jun 19, 2024
1 parent 8a1d4dd commit 2403417
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jobs/backup/rotate_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@
has_more_files = result.has_more
files.extend(result.entries)

print("Starting rotation")
number_of_files = len(files)
for file in files:
if file.name.find("metakgp_wiki") == -1:
continue
files.remove(file)

number_of_files = len(files)
print(f"{number_of_files} backup files found.")

print("Starting rotation")
for file in files:
file_timestamp = file.client_modified
days_old = (now - file_timestamp).days
if days_old > 30 and (number_of_files - counter) > 30:
Expand Down

0 comments on commit 2403417

Please sign in to comment.