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