Files
skillshare/website/docs/commands/backup.md
T
Willie 0bf84493cc feat: split XDG data/state dirs and add Windows legacy migration
Separate backups/trash into XDG_DATA_HOME and logs into XDG_STATE_HOME
instead of keeping everything under XDG_CONFIG_HOME. Add automatic
migration at startup to move existing data to the new locations.

Fix Windows path resolution: DataDir() and StateDir() now fall back to
%AppData% on Windows (matching BaseDir()), preventing incorrect use of
~/.local/share and ~/.local/state paths.

Add MigrateWindowsLegacyDir() to move pre-v0.13.0 data from
~\.config\skillshare\ to %AppData%\skillshare\ on Windows.

Update doctor, oplog, backup, trash, and all tests/docs accordingly.
2026-02-16 10:41:14 +08:00

2.3 KiB

sidebar_position
sidebar_position
2

backup

Create, list, and manage backups of target directories.

skillshare backup              # Backup all targets
skillshare backup claude       # Backup specific target
skillshare backup --list       # List all backups
skillshare backup --cleanup    # Remove old backups

Automatic Backups

Backups are created automatically before:

  • skillshare sync
  • skillshare target remove

Location: ~/.local/share/skillshare/backups/<timestamp>/

Commands

Create Backup

skillshare backup              # All targets
skillshare backup claude       # Specific target
skillshare backup --dry-run    # Preview

List Backups

skillshare backup --list
All backups (15.3 MB total)
  2026-01-20_15-30-00  claude, cursor     4.2 MB  ~/.config/.../2026-01-20_15-30-00
  2026-01-19_10-00-00  claude             2.1 MB  ~/.config/.../2026-01-19_10-00-00
  2026-01-18_09-00-00  claude, cursor     4.0 MB  ~/.config/.../2026-01-18_09-00-00

Cleanup Old Backups

skillshare backup --cleanup           # Remove old backups
skillshare backup --cleanup --dry-run # Preview cleanup

Default cleanup policy:

  • Keep last 10 backups
  • Remove backups older than 30 days
  • Cap total size at 100 MB

Options

Flag Description
--list, -l List all backups
--cleanup, -c Remove old backups
--target, -t <name> Target specific backup
--dry-run, -n Preview without making changes

Backup Structure

~/.local/share/skillshare/backups/
├── 2026-01-20_15-30-00/
│   ├── claude/
│   │   ├── skill-a/
│   │   └── skill-b/
│   └── cursor/
│       ├── skill-a/
│       └── skill-b/
└── 2026-01-19_10-00-00/
    └── claude/
        └── ...

What Gets Backed Up

  • Regular directories in targets (actual skill files)
  • Not backed up: Symlinks (they just point to source)

This means:

  • In merge mode: Only local-only skills are backed up
  • In symlink mode: Nothing is backed up (entire dir is symlink)