Space hygiene ops
Keep one space tidy without a migration project. This recipe is a vertical workflow: see the tree → find stale pages → list or export → move in the same space. It uses Shell for Confluence Cloud 3.5.0 only.
Open the Cloud console, then cd into the space you care about.
1. See the tree
Section titled “1. See the tree”$ cd YourSpace$ tree -L 2$ tree ./Archive -L 3tree prints an ASCII page tree (default depth 3; use -L / --maxdepth to change it). It is a visual listing only — not a bulk tree copy or migrator.
2. Find stale pages
Section titled “2. Find stale pages”$ find . -mtime +30$ find ./Projects -mtime +365 -prune$ find ./Projects -mtime +365 -prune | head 20find -mtime filters by last update (content version when), not created date. Spaces never match -mtime. Prefer -prune before piping into mv so you keep top-most matches and do not flatten parents beside children. The search index may lag ls -l for a short time after edits.
3. List and export
Section titled “3. List and export”$ ls -l$ ls --format csv$ ls --format=csv | less$ ls --format csv | head 30Richer ls -l shows page id, status, version, owner, last-update date, title, and url. For machine-readable output use ls --format csv / ls --format=csv (header + RFC 4180; UTC ISO). There is no > redirect — copy from the terminal or pipe to less / head / grep.
4. Same-space move (preview first)
Section titled “4. Same-space move (preview first)”$ mkdir ./Archive$ find ./Projects -mtime +365 -prune | mv -n ./Archive$ find ./Projects -mtime +365 -prune | head 100 | mv ./Archivemv and cp stay in a single space, at most 100 sources per run (named paths, globs, or piped paths). Preview with -n / --dry-run, then drop it when the preview looks right. Split larger sets and run again.
Boundaries
Section titled “Boundaries”- Same space only. Not a bulk page-tree migrator. No cross-space bulk moves.
treedoes not copy attachments or recreate a tree elsewhere.- Caps and interrupt: long walks may hit path / fetch caps; press Esc or Ctrl+C while working….
Related recipes: Reorganize pages, Search and audit content. Command details: command reference. Limits: Limitations.