R/sendAllFiles.R

Defines functions sendAllFiles.awss3 sendAllFiles.default sendAllFiles

Documented in sendAllFiles sendAllFiles.awss3 sendAllFiles.default

#' @details
#' \code{sendAllFiles} Sends all files in \code{src} to \code{dest} using \code{sendFile}.
#'
#' @rdname rsync
#' @export
sendAllFiles <- function(db, ...) {
  UseMethod("sendAllFiles", db)
}

#' @rdname rsync
#' @export
sendAllFiles.default <- function(db, ...) {
  sendFile(db, fileName = ".", ...)
}

#' @rdname awss3
#' @export
sendAllFiles.awss3 <- function(db, verbose = FALSE, ...) {
  args <- if (!verbose) "--quiet --no-progress --only-show-errors" else ""
  args <- paste("sync", args)

  src <- getSrc(db)
  dest <- getDest(db)
  profile <- getProfile(db)

  awscli(src, dest, args = args, profile = profile)
  db
}
INWTlab/rsync documentation built on April 3, 2022, 10:11 a.m.