File tree Expand file tree Collapse file tree 5 files changed +47
-3
lines changed
Expand file tree Collapse file tree 5 files changed +47
-3
lines changed Original file line number Diff line number Diff line change 55/.idea
66/rootfs /cn_s3_api /__pycache__
77.DS_Store
8+ conf /id_ed25519
Original file line number Diff line number Diff line change 1+ # syncS3
2+ sync a local folder to S3.
3+
4+ ## Description
5+ SyncS3 is a little utlity that watch file changes in a directory and push them in a S3
6+ it uses notification of the kernel to see what files are wrote
7+
8+ ## How to use it
9+ All is ready in a docker image. You have just to set some parameters
10+
11+ ### docker-compose.yml
12+ ```
13+ services:
14+ app:
15+ env_file: .env
16+ build: .
17+ container_name: "sync"
18+ volumes:
19+ - ./data/storage:/data
20+ - ./logs:/var/log/s3sync
21+ ```
22+ the directory to watch must mounted in volume. In this exemple (for bareos : /home/docker/bareos-sd/data/storage)
23+
24+ ### variables
25+ fichier .env
26+ ```
27+ ## Endpoint S3
28+ S3_ENDPOINT=https://s3.rbx.io.cloud.ovh.net/
29+ ## Key Id
30+ S3_KEY_ID=xx
31+ ## Secret
32+ S3_KEY_SECRET=xx
33+ ## Region
34+ S3_REGION=RBX
35+ ## bucket
36+ S3_BUCKET=My-Bucket
37+ ## dir_source (always /data) mounted volume
38+ DIR_SOURCE=/data
39+ ## Prefix S3 exemple file foo.txt will be named /data-sd1/foo.txt in S3
40+ S3_DIR_DEST=/data-sd1
41+ ```
42+
Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ services:
66 volumes :
77 - ./data/storage:/data
88 - ./logs:/var/log/s3sync
9+ - ./conf:/conf
Original file line number Diff line number Diff line change 11[config]
22type=sftp
3- host= ${SFTP_HOST}
4- user= ${SFTP_USER}
3+ host=${SFTP_HOST}
4+ user=${SFTP_USER}
55private_key_file=${SFTP_PRIVATE_KEY_FILE}
66dir_source=${DIR_SOURCE}
77dir_dest=${DIR_DEST}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def open_ssh_conn():
1010 try :
1111 pkey = paramiko .Ed25519Key .from_private_key_file (key_file )
1212 except Exception as e :
13- # print("An exception occurred: {}".format(e))
13+ print ("An exception occurred reading key : {}" .format (e ))
1414 pass
1515 try :
1616 pkey = paramiko .RSAKey .from_private_key_file (key_file )
You can’t perform that action at this time.
0 commit comments