- Knownframe
- CookDex
- Docs
- v2026.10.5
- Backup and cleanup tasks
Backup and cleanup tasks
Backing up Mealie before changes, restoring recipes the cleanup deleted, and merging duplicate entries. Live runs of other tasks can make their own backup first; see Safety policies.
mealie-backup
Section titled “mealie-backup”| 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. |
Back up Mealie in Tools. Mealie can take a while to write a backup of a big library, so CookDex waits up to 30 minutes for it to finish (Wait for a Mealie backup (minutes) in Settings → Updates and runs, up to 240). A 12,000-recipe library took just over 14 minutes; more images need longer. The default was 15 minutes before 2026.10.1; if you had saved 15 yourself, it stays at 15. The same wait applies to the backup a job makes before it changes anything.
Stopping a job while its backup runs ends the backup, and the job doesn’t start.
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.
Recently deleted
Section titled “Recently deleted”When the junk filter or the duplicate finder in Clean up the recipe list deletes a recipe, CookDex first saves a full copy: the recipe, its photo, why it was deleted, when, and which run did it. If the copy can’t be saved, the recipe isn’t deleted.
The Recently deleted tab on the Library lists those recipes with their reason (for example “Duplicate of ‘Chili’, which was kept”), what the copy holds, how many days it’s kept, and a link to the run that deleted it. The top of the tab shows how many copies there are and how much space they take. For each recipe:
- Restore puts it back in Mealie, with its ingredients, steps, photo, tags, categories and tools. It’s a quick job, so it doesn’t wait behind long jobs unless they change recipes. CookDex uses Mealie’s own recipe import; if Mealie won’t take it, CookDex makes the recipe again from the copy and links its tags, categories, tools, foods and units by name. A restored recipe’s web address and id may change.
- Delete now drops the copy early. The recipe is already gone from Mealie, so it can’t be restored after that.
Copies are kept for 30 days, then removed. To change that, set Keep deleted recipes for (days) (DELETED_RECIPES_KEEP_DAYS, 1 to 3650) in Settings → Updates and runs. Copies are stored in CookDex’s ./cache volume, next to its database. Restoring works with Mealie 3.21 to 3.29.
Owners can always restore and delete copies. Editors can when an owner has approved live cleanups for Clean up the recipe list; see Safety policies.
Recently deleted and backups
Section titled “Recently deleted and backups”Recently deleted only covers recipes the junk filter and the duplicate finder delete. Renames, merges and every other change aren’t kept this way, so Back up Mealie first (recommended) is still offered when you apply changes and is still worth keeping on. A Mealie backup restores the whole library to one moment; Recently deleted brings back single recipes without touching anything else.
cleanup-duplicates
Section titled “cleanup-duplicates”| 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.