Skip to content

Instantly share code, notes, and snippets.

@sarangnx
Created June 6, 2023 06:20
Show Gist options
  • Select an option

  • Save sarangnx/81c4fcd82d01226e14ae4ad798eced11 to your computer and use it in GitHub Desktop.

Select an option

Save sarangnx/81c4fcd82d01226e14ae4ad798eced11 to your computer and use it in GitHub Desktop.

Revisions

  1. sarangnx created this gist Jun 6, 2023.
    7 changes: 7 additions & 0 deletions docker-logs-cleanup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/bin/bash

    container_ids=$(docker ps -q)

    for container_id in $container_ids; do
    sudo truncate -s 0 $(docker inspect --format='{{.LogPath}}' "$container_id")
    done