aws_s3_download: download files or folders to AWS

View source: R/utils-aws-download.R

aws_s3_downloadR Documentation

download files or folders to AWS

Description

Providing a key that is a folder and path that is a folder will result in the whole folder being copied to the path location. If you supply "" to key, the whole bucket will be downloaded. Use copy_s3_dir_structure to copy the bucket "directory" structure.

Usage

aws_s3_download(
  path,
  bucket,
  key,
  copy_s3_dir_structure = FALSE,
  check = TRUE,
  error = FALSE
)

Arguments

path

String. Path to download location. Could be a folder or specific file(s)

bucket

The name of the bucket to be downloaded from

key

The key or name for the file or folder to be download from the bucket. Should end with "/" for folders. Use "" to download whole bucket.

copy_s3_dir_structure

Logical. Should the structure of the S3 bucket be recreated as sub directories to the path argument?

check

Whether to check if the exact file already exists in the download location and skip downloading. Defaults to TRUE

error

Whether error out if the file is missing, folder is empty, or system environment variables are missing. Otherwise a message will print but an empty list will be returned.

Value

A list, each element having the key, etag (hash), and path of downloaded files


ecohealthalliance/containerTemplateUtils documentation built on March 31, 2024, 7:46 a.m.