Skip to contents

Zips the .jellyqda project file (and the originals/ directory, if present) into a timestamped .zip. The default backup directory is jellyqda-backups/ outside the project folder, so a backup survives a broken project directory (a project lying directly in R's temporary folder, as in the examples, keeps them inside its folder instead, so nothing is left behind there). Old backups are rotated: only the newest keep snapshots are kept.

Usage

qda_backup(path = NULL, keep = 10, quiet = FALSE, auto = FALSE)

Arguments

path

Backup directory. Defaults to jellyqda-backups/ next to the parent of the project folder.

keep

How many snapshots to keep (rotation).

quiet

Suppress the message.

auto

Internal: called by the auto-snapshot mechanism.

Value

Invisibly, the path of the written zip file.

Details

An automatic snapshot is also taken after every auto_snapshot logged actions (see qda_open()).

Examples

qda_open(file.path(tempfile(), "example.jellyqda"))
qda_import(system.file("extdata", "interview_01.txt", package = "jellyqda"))
#> # A tibble: 1 × 5
#>      id name             format chars status
#>   <int> <chr>            <chr>  <int> <chr> 
#> 1     1 interview_01.txt txt      856 ok    
zip_file <- qda_backup(quiet = TRUE)
basename(zip_file)
#> [1] "example_20261130-150555.zip"
# own backup folder and number of backups to keep:
qda_backup(path = file.path(tempfile(), "my-backups"), keep = 20, quiet = TRUE)
qda_close()