Creates a new timestamped archive in GCS from local files. Only creates a new archive if local files differ from the latest archive. The archive timestamp is derived from the maximum file modification time (not render/wall-clock time), so re-rendering with unchanged files produces the same timestamp and skips upload.
Usage
sync_to_gcs_archive(
dir_csv,
provider,
dataset,
gcs_bucket = "calcofi-files-public",
archive_prefix = "archive",
force = FALSE
)Value
List with:
archive_timestamp: Timestamp of the archive used/createdarchive_path: Full GCS path to archivecreated_new: Logical, TRUE if new archive was createdfiles_uploaded: Number of files uploaded (0 if using existing)
Examples
if (FALSE) { # \dontrun{
result <- sync_to_gcs_archive(
dir_csv = "/path/to/csv",
provider = "swfsc.noaa.gov",
dataset = "calcofi-db")
message(glue("Using archive: {result$archive_timestamp}"))
} # }