Removes data files that are no longer referenced by any snapshot.
Run this after db_vacuum() or db_compact() to reclaim disk space.
When files become orphaned:
After
db_vacuum()removes old snapshotsAfter
db_compact()merges files (old small files become orphaned)After failed transactions that wrote partial data
See also
db_vacuum() to remove old snapshots, db_compact() to merge files
Examples
if (FALSE) { # \dontrun{
db_connect()
# Compact files then clean up
db_compact(table = "imports")
db_cleanup_files(dry_run = FALSE)
# Vacuum old snapshots then clean up
db_vacuum(older_than = "30 days", dry_run = FALSE)
db_cleanup_files(dry_run = FALSE)
} # }