Spaces:
Sleeping
Sleeping
Create s3_syncer.py
Browse files- src/cloud/s3_syncer.py +10 -0
src/cloud/s3_syncer.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
class S3Sync:
|
| 4 |
+
def sync_folder_to_s3(self, folder, aws_bucket_url):
|
| 5 |
+
command=f"aws s3 sync {folder} {aws_bucket_url}"
|
| 6 |
+
os.system(command)
|
| 7 |
+
|
| 8 |
+
def sync_foldere_from_s3(self, folder, aws_bucket_url):
|
| 9 |
+
command=f"aws s3 sync {aws_bucket_url} {folder}"
|
| 10 |
+
os.system(command)
|