Skip to contents

Backup files

Usage

rb_backup(
  path,
  project = NULL,
  first_level_folders = NULL,
  first_level_files = TRUE,
  max_level = 100,
  recurse = TRUE,
  glob = NULL,
  create = TRUE,
  update = FALSE,
  cache = TRUE,
  base_folder = "rbackupr"
)

Arguments

path

Local path where files to backup are stored.

project

Defaults to NULL. Can be set once per session with `rb_get_project_name()`. If given, must be a character vector of length one: name of the project.

first_level_folders

Defaults to NULL. If given, clarifies which folders within the path should be uploaded, keeping the folder structure.

first_level_files

Logical, defaults to TRUE. If FALSE, first level files (files that are directly under the project folder, rather than a subfolder) are not included in the backup.

max_level

Defaults to 100. Maximum level of sub-folders to backup. Default means it will go 100 times deep into sub-folders. Used also to prevent infinite loops.

recurse

Defaults to TRUE. Recurse up to one level.

glob

Defaults to NULL. Can be used to filter type of files to upload, e.g. "*.jpg"

create

Logical, defaults to TRUE. Create folders if missing. Set to FALSE if you are sure there are no new folders to raise an error if something unexpected happens.

update

Logical, defaults to FALSE. If TRUE, checks on Google Drive for newly updated files or folders, otherwise it assumes that only files and folders listed in cache exist online.

cache

Logical, defaults to TRUE. Stores locally cached information about base and project folder.

base_folder

Name of base folder, defaults to `rbackupr`

Examples

if (FALSE) {
if (interactive()) {
  rb_backup(path = "folder_to_backup", project = "test_project")
}
}