Recovery has exactly two states: with a backup, ten minutes; without one, reconfigure from scratch. The drill exists to confirm which state you are in before it matters.
Back up now (one minute)
cd ~/.dsh && tar -czf ~/dsh-profiles-$(date +%Y%m%d).tgz profiles ls -lh ~/dsh-profiles-*.tgz
profiles is around 1 MB. There is no excuse.
Drill: break it on purpose, then restore
- Confirm it works now:
dsh --profile web --dump-config | head - Add a line of invalid content to
~/.dsh/profiles/web/cordis.patch.ymland confirm startup fails. This teaches you what broken looks like. - Extract the backup over the directory.
- Run dump again and confirm recovery.
cd ~/.dsh && tar -xzf ~/dsh-profiles-20261114.tgz && dsh --profile web --dump-config | head
Careful: cordis.yml is not the file to edit
The header in the local cordis.yml says it plainly:
# dsh profile root — an empty entry list. The tree is composed as patches: # each bundle in package.json's dsh.profile.bundles, then cordis.patch.yml, then any # --patch overlays. Edit cordis.patch.yml, not this file. []
Composition order: bundles from package.json, then cordis.patch.yml, then command-line --patch. Edits to cordis.yml are effectively discarded by later layers while you believe they applied.
If there is no backup
dsh --dump-default-configprints the default tree without the user layer; diff against it to find your extra edits.- Rebuild a profile by copying one that still works, then re-add changes from memory.
- The bundles list lives in
package.json— the easiest item to forget when rebuilding.