Skip to content

bucket_upload_folder

jaybgager edited this page Sep 25, 2026 · 1 revision

Warning

Existing files or folders in the bucket folder with the same name (and path in the case of those in subfolders) as those in the folder being uploaded will be overwritten.

Uploads the contents of a local folder onto a cloudfiles-managed S3-style bucket. Requires permission to write to the bucket.

Arguments:

  • local_path (string, mandatory)
    • the absolute path on your local machine to the folder whose contents you want to upload
  • bucket_path (string, mandatory)
    • the absolute path on the bucket to the folder where you want to upload the folder
    • the last directory will be the name of the folder where the contents of the local folder will be added
    • this will create new folders where none exist

Example

INPUT:

import tracertools as tt

tt.bucket_upload_folder(
    local_path = "/home/username/path/to/local_folder"
    bucket_path = "bucket://path/to/destination_folder"
)

This will copy the contents of the local_folder folder into the folder located at bucket://path/to/destination_folder on the bucket.

Clone this wiki locally