Python Forum
uploading files from a ubuntu local directory to Minio storage container
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
uploading files from a ubuntu local directory to Minio storage container
#1
I want to upload files (text and binary) from my local machine running ubuntu 20.04 to a Minio storage container also in the same machine.
below are the variables for the files
local_path = /usr/carte/proftpd/aws01y
minio_path = original/tza/a
S3_BUCKET_INCOMING = 'Data-incoming'
my problem is where should i define the local_path and mino_path inside my code so that python will know where to file the files and where to put them

here is my code

import glob
import sys

from minio import Minio

local_path = sys.argv[1]
minio_path = sys.argv[2]

filepaths = glob.glob(local_path)
if len(filepaths) == 0:
    print(f'No files found for pattern={local_path}')

S3_ENDPOINT = 'http://localhost:9000'
S3_USER = 'Tzabox'
# replace with the value of STORAGE_PASSWORD in your .env file
S3_PASSWORD = '******'
S3_BUCKET_INCOMING = 'Data-incoming'
if S3_ENDPOINT != '':
    endpoint = ''
    if S3_ENDPOINT.startswith('https://'):
        is_secure = True
        endpoint = S3_ENDPOINT.replace('https://', '')
    else:
        is_secure = False
buran write Dec-22-2023, 10:15 AM:
S3 Password replaced with asterisks. Anyway I would replace it if I were you.
buran write Dec-22-2023, 08:04 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  deleting files in program files directory RRADC 6 3,189 Aug-21-2024, 06:11 PM
Last Post: snippsat
Bug Python 3.12 cannot import local python files as modules sunflowerdog 25 20,174 Jul-31-2024, 01:52 PM
Last Post: sunflowerdog
  Filer and sort files by modification time in a directory tester_V 5 2,478 May-02-2024, 05:39 PM
Last Post: tester_V
  Loop through all files in a directory? Winfried 10 4,472 Apr-23-2024, 07:38 PM
Last Post: FortuneCoins
  Upload Files to Azure Storage Container phillyfa 6 3,176 Dec-22-2023, 06:11 AM
Last Post: Pedroski55
  change directory of save of python files akbarza 3 3,483 Jul-23-2023, 08:30 AM
Last Post: Gribouillis
  Using pyinstaller with .ui GUI files - No such file or directory error diver999 3 8,042 Jun-27-2023, 01:17 PM
Last Post: diver999
  Monitoring a Directory for new mkv and mp4 Files lastyle 3 2,800 May-07-2023, 12:33 PM
Last Post: deanhystad
Lightbulb shutdown host from docker container cosmin1805 0 1,683 Nov-27-2022, 06:34 PM
Last Post: cosmin1805
  networkx package is not visible in singularity container image erdemath 11 4,492 Oct-14-2022, 12:04 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020