Skip to content
CookDex docs

Backup and cleanup tasks

Backing up Mealie before changes, and merging duplicate entries. Live runs of other tasks can make their own backup first; see Safety policies.

Option Type Default Description
keep integer unset After creating a backup, delete older backups this task made, keeping this many.
prune_only boolean false Skip backup creation and only delete older backups this task made. Requires keep.

CookDex records every backup it creates in backup_ledger.json in the checkpoint directory (cache/maintenance by default), and pruning only ever deletes backups listed there. Backups made in Mealie, uploaded to it, or made before CookDex kept the ledger are never deleted. The backup taken before a change (Backup First) is recorded separately; CookDex keeps the newest 10 of those, and they don’t count against keep.

Option Type Default Description
dry_run boolean true Preview merges without writing anything.
backup_first boolean true Create a Mealie backup before a live run. Hidden while dry_run=true.
target string both Deduplicate both (foods and units), foods, units, taxonomy (tags and categories), tags, or categories.

Tags and categories are merged through Mealie’s POST /organizers/tags/merge and POST /organizers/categories/merge routes (Mealie v3.25+). Mealie moves every recipe from the duplicate to the kept entry and deletes the duplicate. Mealie does not update cookbook filters that name the duplicate, so CookDex repoints those cookbooks at the kept entry. The kept entry is the one used by the most recipes. Matching is conservative: names must differ only by case, spacing, punctuation, accents, & vs and, or a plural ending on the last word whose singular also exists (for example Gluten-Free / gluten free, or Cookie / Cookies). On an older Mealie the merge routes are missing; the run reports this and skips those merges without failing.