Skip to content

Commit

Permalink
Backup to .zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
everaldorodrigo committed Sep 25, 2024
1 parent 42701c1 commit 3e7abe1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def restore_from_s3(filename=None, bucket="smartapi"):

obj = s3.get_object(Bucket=bucket, Key=filename)

filename = filename.replace("db_backup/", "")

if filename.endswith(".zip"):
with open(filename, "wb") as temp_file:
temp_file.write(obj["Body"].read())
Expand Down

0 comments on commit 3e7abe1

Please sign in to comment.