Skip to content

Conversation

@vosslab
Copy link

@vosslab vosslab commented Jan 16, 2026

Title: Preserve symlinks and avoid large tmp data in account backups

Problem:

  • Backups could dereference symlinks, storing link targets as regular files.
  • Restores could prompt or fail when extracting over existing paths.
  • The backup archive included .codex/tmp, which can be very large (100+ MB) while the rest of the account data is small.

Change:

  • Use cp -RP and zip -y so symlinks are stored as symlinks.
  • Remove ${tmpdir}/.codex/tmp before zipping to avoid saving transient patch/tmp data.
  • Remove any existing archive before zipping to prevent stale entries.
  • Extract into an empty subdirectory and use unzip -o to avoid interactive prompts and handle path edge cases.

User impact:

  • Backups preserve symlinks and are much smaller (tmp excluded).
  • Restores are non-interactive and more reliable.

Testing:

  • Verified a symlink inside CODEX_HOME remains a symlink after save and restore.
  • Verified .codex/tmp is not present in the archive and archive size drops substantially when tmp is large.
  • Restored over an existing account without prompts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant