aws_bucket_download: Download an S3 bucket

View source: R/bucket.R

aws_bucket_downloadR Documentation

Download an S3 bucket

Description

Download an S3 bucket

Usage

aws_bucket_download(bucket, dest_path, ...)

Arguments

bucket

(character) bucket name. required

dest_path

(character) destination directory to store files. required

...

named parameters passed on to s3fs::s3_dir_download()

Value

path (character) to downloaded file(s)/directory

Note

Requires the env var AWS_REGION. This function prompts you to make sure that you want to delete the bucket.

See Also

Other buckets: aws_bucket_create(), aws_bucket_delete(), aws_bucket_exists(), aws_bucket_list_objects(), aws_bucket_tree(), aws_bucket_upload(), aws_buckets(), six_bucket_delete(), six_bucket_upload()

Examples


bucket <- random_bucket()
aws_bucket_create(bucket = bucket)
desc_file <- file.path(system.file(), "DESCRIPTION")
aws_file_upload(desc_file, s3_path(bucket, "DESCRIPTION.txt"))
aws_file_upload(desc_file, s3_path(bucket, "d_file.txt"))
temp_dir <- file.path(tempdir(), bucket)
aws_bucket_download(bucket = bucket, dest_path = temp_dir)
fs::dir_ls(temp_dir)

# cleanup
six_bucket_delete(bucket, force = TRUE)


sixtyfour documentation built on April 3, 2025, 8:22 p.m.