1 | # s3-bsync Copyright (c) 2022 Joshua Stockin |
2 | # <https://joshstock.in> |
3 | # <https://git.joshstock.in/s3-bsync> |
4 | # |
5 | # This software is licensed and distributed under the terms of the MIT License. |
6 | # See the MIT License in the LICENSE file of this project's root folder. |
7 | # |
8 | # This comment block and its contents, including this disclaimer, MUST be |
9 | # preserved in all copies or distributions of this software's source. |
10 |
|
11 | import os |
12 | import time |
13 | import logging |
14 | import glob |
15 |
|
16 | from .classes import * |
17 | from . import syncfile |
18 |
|
19 | logger = logging.getLogger(__name__) |
20 |
|
21 | __all__ = ["bucket_scan"] |
22 |
|
23 |
|
24 | COMPARE_RESULTS = { |
25 | "LOCAL_NOT_FOUND": 0b00000001, |
26 | "S3OBJ_NOT_FOUND": 0b00000010, |
27 | "LOCAL_OLDER": 0b00000100, |
28 | "LOCAL_LARGER": 0b00001000, |
29 | "S3OBJ_OLDER": 0b00010000, |
30 | "S3OBJ_LARGER": 0b00100000, |
31 | } |
32 |
|
33 | def by_bucket(bucket: sync_managed_bucket): |
34 | for dirmap in bucket.directory_maps: |
35 | for root, dirs, files in os.walk(dirmap.local_path): |
36 | for file in files: |
37 | logger.debug(f"{os.path.join(root, file)}") |
38 |
|