Skip to content

Audit Logs

ZestSSH maintains a database-backed audit trail of all automation executions. This provides visibility into headless SSH operations triggered by external automation apps (Tasker, MacroDroid, iOS Shortcuts) or internal workflows.

Every automation execution creates an AutomationHistory entry with the following fields:

FieldTypeDescription
idTextUnique identifier for the entry
timestampDateTimeWhen the execution occurred
actionTextAction type (see below)
connectionIdTextConnection label or ID that was targeted
commandTextThe command executed, snippet name, or workflow name
snippetNameText (nullable)Snippet name, if the action was snippet
stdoutTextCommand standard output
stderrTextCommand standard error output
exitCodeInteger (nullable)Process exit code (null if unavailable)
successBooleanWhether the execution succeeded
elapsedMsIntegerElapsed time in milliseconds
ActionTrigger
executeDirect command execution via automation intent
snippetNamed snippet triggered by automation
batchBatch execution of multiple commands
connectConnection establishment via automation
workflowMulti-step workflow execution

Audit logs are stored in the local SQLite database (Drift ORM) in the automation_history table. They are:

  • Local only — Not synced to Cloud Sync (audit logs are device-specific).
  • Not included in backups — Backup files contain connection data, not execution history.
  • Capped at 500 entries — The trim(500) method automatically removes the oldest entries when the cap is exceeded.
  1. Go to Automation > History (accessible from the automation section in navigation).
  2. The history screen displays all entries sorted newest-first.

Each entry shows:

  • Timestamp
  • Action type with a visual indicator
  • Target connection
  • Command or snippet name
  • Success/failure status
  • Exit code (if available)
  • Elapsed time

Tap an entry to see the full stdout and stderr output.

The automation history screen supports:

  • Search — Filter entries by connection name, command text, or snippet name.
  • Filter by action type — Show only specific action types (execute, snippet, batch, connect, workflow).
  • Filter by status — Show only successful or failed executions.

To delete all audit log entries:

  1. Go to Automation > History.
  2. Tap the clear/delete button.
  3. Confirm the deletion.

This calls deleteAll() on the AutomationHistoryDao.

The trim(maxEntries) method keeps only the most recent entries:

  1. Fetches all entries sorted by timestamp (newest first).
  2. If the count exceeds maxEntries, deletes everything beyond the limit.
  3. The default cap is 500 entries.

The deleteOlderThan(cutoff) method removes entries with a timestamp before the specified DateTime. This can be used for periodic cleanup of old entries.

The AutomationHistory table is defined as a Drift table class with the following constraints:

  • action field has a length constraint of 1—32 characters.
  • stdout and stderr default to empty strings.
  • exitCode is nullable (not all operations produce an exit code).
  • snippetName is nullable (only populated for snippet actions).
  • Primary key is the id field.