Back up and rename the file or directory
Examples
path <- tempfile()
file.create(path)
#> [1] TRUE
path2 <- backup_file(path, remove = TRUE)
#> Moving file file16e85f3be5e1
#> => file16e85f3be5e1_[backup_20250213_170037]
file.exists(c(path, path2))
#> [1] FALSE TRUE
unlink(path2)