Download an S3 bucket
Arguments
- bucket
(character) bucket name. required
- dest_path
(character) destination directory to store files. required
- ...
named parameters passed on to
s3fs::s3_dir_download()
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()
Examples
if (FALSE) { # interactive()
bucket <- random_string("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
aws_bucket_delete("tmp-bucket-369")
}