Skip to main content

Kali/Linux auto-logging of all terminal sessions using script(1), with optional tmux, logrotate, and rclone sync.

Project description

kautolog

PyPI version

Auto-log everything you see in every terminal tab on Kali/Linux using script(1). Captures prompt, commands, output, ANSI colors, and ncurses apps with optional timing/replay, tmux per-pane logs, logrotate, and rclone cloud sync.

Install

Recommended:

pipx install kautolog
kautolog install

This will:

  • Hook into both ~/.bashrc and ~/.zshrc for Zsh and Bash auto-logging.
  • Install kautolog-replay script into ~/.local/bin.

kautolog install Options

Flag Default Description
--logdir PATH ~/terminal-logs Custom log output directory
--with-tmux False Add autologging to ~/.tmux.conf
--with-logrotate / --no-logrotate True Install user-level logrotate config
--with-sync remote:path (none) Enable rclone sync (e.g. gdrive:kautolog-logs)
--interval N 10 Sync interval in minutes for systemd timer

Replaying logs

To replay a session with timing:

kautolog replay ~/terminal-logs/2025/08/10/kali-33608-203123

To instantly dump the log without delay:

kautolog replay -i ~/terminal-logs/2025/08/10/kali-33608-203123

kautolog replay Options

Flag / Arg Description Notes
<log_base> Path to .log file or base name (no extension) Required
-i Instant dump (no timing) Just prints the .log file
-d <num> Speed multiplier (divisor) -d 2 = 2× faster, -d 10 = 10× faster, -d 0.5 = 2× slower
-m <secs>, --maxdelay <secs> Maximum delay between lines Clamps long pauses (e.g. -m 0.1)
--target <secs> Normalize total replay to target duration Auto-computes divisor; also sets --maxdelay 0.12 if not provided

Log Format

Logs are saved to:

~/terminal-logs/YYYY/MM/DD/hostname-PID-TIMESTAMP.log
~/terminal-logs/YYYY/MM/DD/hostname-PID-TIMESTAMP.timing

If --with-tmux is used, each tmux pane logs independently.

Enabling Automatic Log Cleanup (Optional)

By default, kautolog install places a logrotate config at:

~/.config/logrotate.d/terminal-logs

Most systems do not run logrotate from this location.
To enable automatic log cleanup, copy it to the system logrotate directory:

sudo cp ~/.config/logrotate.d/terminal-logs /etc/logrotate.d/terminal-logs

This will:

  • Rotate logs daily
  • Keep 14 days of logs
  • Compress old logs
  • Prevent unlimited disk usage

Uninstall

kautolog uninstall

Removes all shell hooks and scripts cleanly.

If you installed using pipx:

pipx uninstall kautolog

License

The scripts and documentation in this project are released under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kautolog-1.1.13.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kautolog-1.1.13-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file kautolog-1.1.13.tar.gz.

File metadata

  • Download URL: kautolog-1.1.13.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kautolog-1.1.13.tar.gz
Algorithm Hash digest
SHA256 44af6e0bae669eb7f1f74db907cb75315e0bce5aeda29836097cda6ba082dbc2
MD5 1c6fcdd3b7d6166423fda4ec7585c386
BLAKE2b-256 f6708b94ce178f8377214e40d182207c60dc7b6862256e412a7ffafb7b276b1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for kautolog-1.1.13.tar.gz:

Publisher: publish.yml on marksowell/kautolog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kautolog-1.1.13-py3-none-any.whl.

File metadata

  • Download URL: kautolog-1.1.13-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kautolog-1.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 09d53992f5b762c2f6dc155fba9c694b786582d9d1b25d9f751357799d0d6a30
MD5 a1fbab067bd03b4f6675852313ddd561
BLAKE2b-256 59b1d7bd25da2aa9b010da4da39b3d5a16d7b6827bccf98645a202c79bf1e0bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for kautolog-1.1.13-py3-none-any.whl:

Publisher: publish.yml on marksowell/kautolog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page