backup_g_file | R Documentation |
Creates a local backup of a Google Drive file.
backup_g_file(
g_id,
path,
type = NULL,
path_gcp_service_account_key = Sys.getenv("PATH_GCP_KEY_ZDA"),
overwrite = TRUE,
force = FALSE,
quiet = TRUE
)
g_id |
Google Drive file ID. A character scalar. |
path |
Path to the local file backup destination. A character scalar. |
type |
Desired type of the Google Drive file to be backed up. Only consulted if |
path_gcp_service_account_key |
Path to the GCP Service Account Key JSON file. See |
overwrite |
Whether or not to overwrite an already existing file under |
force |
Whether or not to force overwriting the file regardless whether it has changed since the last backup or not. |
quiet |
Whether or not to suppress printing status output from googledrive operations. |
Essentially a convenience wrapper around googledrive::drive_download()
.
If a Google Sheet that includes multiple worksheets is backed up to a file type
that doesn't support
worksheets like "csv"
, only the default (first) worksheet is written. In contrast, backup_g_sheet()
allows to specify any worksheet to be backed up (but
always writes a single worksheet only regardless of the filetype).
An object of class dribble, a tibble with one row per file if local backup was (over)written, otherwise NULL
, meaning
the remote file hasn't deviated from the local backup since the last run, invisibly.
Other Google Apps functions:
auth_g_drive_gcp()
,
auth_g_sheets_gcp()
,
backup_g_sheet()
,
g_file_mod_time()
,
upload_to_g_drive()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.