Index

s3-bsync / master

Bidirectional syncing tool to sync local filesystem directories with S3 buckets. (Incomplete)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
1614 Jul 2022 17:1211b250eUpdate debug messages, begin filescan implementationJosh Stockin1370G

Blob @ s3-bsync / src / filescan.py

application/x-python1043 bytesdownload raw
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
11import os
12import time
13import logging
14import glob
15
16from .classes import *
17from . import syncfile
18
19logger = logging.getLogger(__name__)
20
21__all__ = ["bucket_scan"]
22
23
24COMPARE_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
33def 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