Index

s3-bsync / 2414eba

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
1419 Jun 2022 18:222414ebaDeserialization and directory mappingJosh Stockin130G

Blob @ s3-bsync / src / __main__.py

application/x-python1359 bytesdownload raw
1#!/usr/bin/env python3
2# s3-bsync Copyright (c) 2021 Joshua Stockin
3# <https://joshstock.in>
4# <https://git.joshstock.in/s3-bsync>
5#
6# This software is licensed and distributed under the terms of the MIT License.
7# See the MIT License in the LICENSE file of this project's root folder.
8#
9# This comment block and its contents, including this disclaimer, MUST be
10# preserved in all copies or distributions of this software's source.
11
12import sys
13import logging
14import pprint
15
16from . import *
17
18logger = logging.getLogger(__name__)
19
20
21def main():
22 args = command_parse.command_parse(sys.argv[1:])
23
24 logLevel = logging.INFO
25 if args.debug:
26 logLevel = logging.DEBUG
27
28 logging.basicConfig(
29 format="\x1b[0;37m[ \x1b[0;35m%(relativeCreated)04d \x1b[0;37m/ \x1b[0;33m%(name)s\x1b[0;37m:\x1b[1;36m%(funcName)s \x1b[0;37m/ \x1b[0;34m%(levelname)s \x1b[0;37m] \x1b[0m%(message)s",
30 datefmt="%H:%M:%S",
31 level=logLevel,
32 )
33
34 if args.debug:
35 logger.debug("Debug mode enabled")
36
37 logger.debug(f"Parsed input arguments:\n{pprint.pformat(vars(args))}")
38 logger.debug("Sanitizing input arguments")
39 settings = command_parse.sanitize_arguments(args)
40
41 logger.debug(f"Interpreted settings:\n{pprint.pformat(vars(settings))}")
42
43 run(settings)
44
45 return 0
46
47
48if __name__ == "__main__":
49 sys.exit(main() or 0)
50