Creates a .tar.gz archive containing simFilename and any additional outputFiles. Files that do not exist are silently skipped so a partially completed simulation can still be archived.

outTar(
  simFilename,
  outputFiles = character(0),
  runName,
  tarDir = dirname(simFilename),
  verbose = TRUE
)

Arguments

simFilename

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

outputFiles

Character vector of additional files to include (e.g. SpaDES.core::outputs(sim)$file). Non-existent paths are dropped. Default character(0).

runName

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

tarDir

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

verbose

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

Value

Invisibly returns the path to the created tarball.