Convenience wrapper that calls outSave(), outTar(), and outUpload() in sequence. The sim is saved to an RDS file, bundled with its output files into a .tar.gz archive, and the archive is uploaded to a Google Drive folder.

outSaveTarUpload(
  runName,
  sim,
  gFolder = NULL,
  simFilename = NULL,
  tarDir = NULL,
  tarball = NULL,
  overwrite = TRUE,
  cleanup = FALSE,
  verbose = TRUE,
  lazy = TRUE
)

Arguments

runName

Character scalar. Used as the base name for the saved sim file and tarball.

sim

A simList object.

gFolder

A Google Drive folder identifier accepted by googledrive::drive_upload() – a dribble, a Drive URL, or a bare folder ID from googledrive::as_id().

simFilename

Character scalar. Full path for the .rds file. Defaults to SpaDES.core::simFile(name = runName, path = outputPath(sim), time = end(sim), ext = "rds").

tarDir

Character scalar. Directory in which to create the tarball. Defaults to dirname(simFilename).

tarball

Character scalar. Path to the local file to upload.

overwrite

Logical. Overwrite an existing file of the same name in the Drive folder. Default TRUE.

cleanup

Logical. Delete the local tarball after a successful upload. Default FALSE.

verbose

Logical. Pass -v to tar for file-by-file progress. Default TRUE.

lazy

Logical. Passed to SpaDES.core::saveSimList(). When TRUE (default), each user object in sim@.xData is saved into a sibling <simFilename>_xData/ directory and lazily restored on load via delayedAssign. outTar() picks up that directory automatically.

Value

Invisibly returns the dribble from googledrive::drive_upload().