cthulhu is a production-oriented, Bash-based framework for archiving and restoring Linux system metadata and user configuration across multiple distributions.
It is designed around three ideas:
- System snapshots are distro-specific (package inventories, distro config, kernel context).
- Core user configs are distro-independent (rofi, picom, dunst, kitty, zsh, etc.).
- Window manager configs are tracked explicitly (dwm, xmonad, plasma).
The implementation is pure Bash with standard Linux tooling, modularized for maintainability and safe-by-default restore behavior.
- Safe operations first: restore paths are never overwritten silently; user confirmation is required.
- Defensive and portable: commands are checked before use; unavailable tools are skipped and logged.
- Predictable filesystem layout: snapshots and component archives have stable, explicit paths.
- Simple extension model: add distro handlers and component mappings without rewriting the CLI.
cthulhu/
├── bin/
│ └── cthulhu
├── lib/
│ ├── detect.sh
│ ├── save_system.sh
│ ├── save_core.sh
│ ├── restore.sh
│ └── utils.sh
├── systems/
│ ├── nixos/
│ ├── gentoo/
│ ├── debian/
│ ├── arch/
│ └── unknown/
├── core/
│ ├── fastfetch/
│ ├── rofi/
│ ├── picom/
│ ├── dunst/
│ ├── kitty/
│ ├── zsh/
│ └── wm/
│ ├── dwm/
│ ├── xmonad/
│ └── plasma/
├── logs/
└── README.md
From repository root:
chmod +x bin/cthulhu
./bin/cthulhu --helpOptionally add bin/ to your PATH.
cthulhu save system
cthulhu save corecthulhu restore system <distro> <YYYY-MM-DD>
cthulhu restore core <component|all>cthulhu list systems
cthulhu list coresave system detects distro from /etc/os-release, then writes into:
systems/<distro>/<YYYY-MM-DD>/
qlist -Ioutput (if available)emerge --infooutput (if available)/var/lib/portage/world(if present)uname -r
/etc/nixos/configuration.nix~/flake.nix(if present)nixos-versionnix-channel --list(if available)
dpkg --get-selections/etc/apt/sources.list/etc/apt/sources.list.duname -r
pacman -Qepacman -Qmuname -r
If a command is missing, it is skipped safely and recorded in logs/cthulhu.log.
save core copies user components when present:
~/.config/fastfetch~/.config/rofi~/.config/picom~/.config/dunst~/.config/kitty~/.zshrc~/.config/dwm~/.xmonad~/.config/plasma*
Data is archived under core/<component>/ while preserving structure via cp -a.
All restore operations follow these rules:
- Confirmation before overwrite for any existing target path.
- Automatic backup of current target content to:
~/.config/cthulhu-backup-<YYYY-MM-DD>/
- Append-only action logging in:
logs/cthulhu.log
System restore copies selected snapshot metadata to:
~/.config/cthulhu-restored-system/
This keeps restore actions explicit and non-destructive.
Every operation logs with timestamp and severity (INFO, WARN, ERROR) into:
logs/cthulhu.log
This includes skipped commands, copied files, backup operations, and restore actions.
To add a new distro:
- Add a directory under
systems/<newdistro>/. - Update
normalize_distro()inlib/detect.sh. - Add
save_<newdistro>()inlib/save_system.sh. - Wire it into
save_system()case dispatch.
To add new core components:
- Add folder under
core/<component>/. - Add
save_componentand restore mapping in:lib/save_core.shlib/restore.sh
The CLI and utilities are already modular, so extension is local and low risk.