Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Fix restore sorting #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/backup-restore-s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def restore(tsm, bucket_name, s3_prefix):
# Sort both lists based on last updated date
def sort_key(obj):
return obj.get("LastModified")
tsbaks.sort(key=sort_key)
settings.sort(key=sort_key)
tsbaks.sort(key=sort_key, reverse=True)
settings.sort(key=sort_key, reverse=True)

# Get an S3 resource reference
s3_resource = boto3.resource('s3')
Expand Down Expand Up @@ -259,4 +259,4 @@ def main():
# Find the latest backup in S3 and use TSM to restore from it
status = restore(tsm=tsm, bucket_name=s3_bucket, s3_prefix=s3_prefix)

main()
main()