p202 system retention set

Set the automatic click-data deletion to N days (0 keeps every click); asks when it would keep less

New in 1.9.77Writescannot be staged
All commands

01Run it

Straight from the command's own help.

p202 system retention set --days 180
p202 system retention set --days 0

02What you get

Pick the shape you need. People get a table. Add --json, --csv or --ndjson for scripts, or -q for ids only. An AI agent gets compact JSON without asking. All output formats

03Build your command

Pick values and the command line writes itself, quoted and ready to paste.

p202 system retention set

Set flags below; the command updates as you type.

04Flags

2 flags, plus the global flags every command takes.

FlagWhat it does
--daysstringrequiredDays of click data to keep, 0-36500 (0 keeps every click) (required)
--force, -fboolSet it without asking, even when it deletes more

05How it works

Sets how many days of click data the cron job's automatic deletion keeps (0 to 36500; 0 keeps everything), for the whole install. When the new value keeps less than the current one (turning deletion on, or a shorter period) it asks first, because what the cron job deletes cannot be recovered; --force skips the question. Cannot be staged.

Needs an Admin or Super user key whose role has access_to_settings (as Account › Settings asks), and system:write.

06For agents

Running this from an agent

  • Read the same facts as JSON: p202 commands system retention set --json.
  • With AI_AGENT, CLAUDECODE or another agent variable set, output is compact JSON and errors arrive on stderr as a JSON envelope with a hint.
  • Exit codes: 0 ok, 1 bad input, 2 auth, 3 network, 4 server error, 5 partial failure.
  • This command writes and cannot be staged: --staged is refused before anything is sent. Have a person run it, or give the agent a key without write scope.
p202 commands system retention set --json
{
  "path": "p202 system retention set",
  "use": "set --days <n>",
  "short": "Set the automatic click-data deletion to N days (0 keeps every click); asks when it would keep less",
  "long": "Sets how many days of click data the cron job's automatic deletion keeps (0 to 36500; 0 keeps\neverything), for the whole install. When the new value keeps less than the current one (turning\ndeletion on, or a shorter period) it asks first, because what the cron job deletes cannot be\nrecovered; --force skips the question. Cannot be staged.\n\nNeeds an Admin or Super user key whose role has access_to_settings (as Account › Settings asks), and system:write.",
  "runnable": true,
  "example": "p202 system retention set --days 180\n  p202 system retention set --days 0",
  "flags": [
    {
      "name": "days",
      "type": "string",
      "default": "",
      "usage": "Days of click data to keep, 0-36500 (0 keeps every click) (required)",
      "required": true
    },
    {
      "name": "force",
      "shorthand": "f",
      "type": "bool",
      "default": "false",
      "usage": "Set it without asking, even when it deletes more",
      "required": false
    }
  ]
}