Skip to contents

Copies a specified file to a backup directory, optionally appending a timestamp.

Usage

rfp_fs_backup(
  path_dir_in,
  path_in_file,
  path_dir_out,
  stamp = format(Sys.time(), "%Y%m%d%H%M")
)

Arguments

path_dir_in

Character. Directory of the input file.

path_in_file

Character. Name of the input file.

path_dir_out

Character. Directory where the backup should be stored.

stamp

Character or NULL. Optional string to append to the filename. Defaults to current timestamp.

Value

Character. Full path to the newly created backup file.

Examples

if (FALSE) { # \dontrun{
path_dir_in <- "~/Projects/gis/sern_peace_fwcp_2023"
path_in_file <- "background_layers.gpkg"
path_dir_out <- "~/Projects/gis/backups"
rfp_fs_backup(path_dir_in, path_in_file, path_dir_out)
} # }