Check file size matches.

This commit is contained in:
Alex Manning 2023-10-24 19:42:17 +01:00
parent 3c5ef98636
commit 4f1c7f6ebb
2 changed files with 7 additions and 3 deletions

View file

@ -1,5 +1,5 @@
name: "Minio Backup"
version: "0.0.8"
version: "0.0.9"
slug: minio-backup
description: >-
"Backup the backup folder using minio."

View file

@ -52,8 +52,12 @@ def main():
else:
obj = objects[file.name]
logger.info("File %s already exists in s3", file.name)
logger.info("s3_size", obj.size)
logger.info("local_size", file.stat().st_size)
if obj.size != file.stat().st_size:
logger.warning(
"Size in s3 (%s) is different to local size (%s)",
obj.size[0],
file.stat().st_size,
)
logger.warning(
"The following files do not already exist and will be backed up: %s", to_upload