Skip to content

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.

$ cd YourSpace
$ tree -L 2
$ tree ./Archive -L 3

tree 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.

$ find . -mtime +30
$ find ./Projects -mtime +365 -prune
$ find ./Projects -mtime +365 -prune | head 20

find -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.

$ ls -l
$ ls --format csv
$ ls --format=csv | less
$ ls --format csv | head 30

Richer 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.

$ mkdir ./Archive
$ find ./Projects -mtime +365 -prune | mv -n ./Archive
$ find ./Projects -mtime +365 -prune | head 100 | mv ./Archive

mv 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.

  • Same space only. Not a bulk page-tree migrator. No cross-space bulk moves.
  • tree does 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.