Last active
September 1, 2024 23:41
-
-
Save innateessence/ab022646a49286b2bfd80a7f8dd50585 to your computer and use it in GitHub Desktop.
Revisions
-
innateessence revised this gist
Sep 1, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ # But sometimes, a script that solves the problem is better. # This CAN cause issues if this runs while docker is appending logs to the file. # It is possibly that if you use this, `docker logs` will throw an error due to a partial log entry being present and unparsable by docker. # Don't use this if you don't understand what I just said in the line above. LOG_PATH="$HOME/Library/Containers/com.docker.docker/Data/log/host" -
innateessence revised this gist
Sep 1, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ # But sometimes, a script that solves the problem is better. # This CAN cause issues if this runs while docker is appending logs to the file. # It is possibly that if you use this, `docker logs` will throw an error due to a partial log entry being present and unparsable by docker. # Don't use this if you don't understand what I just said. LOG_PATH="$HOME/Library/Containers/com.docker.docker/Data/log/host" -
innateessence revised this gist
Sep 1, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # I am aware this can be handled via configuration instead. # But sometimes, a script that solves the problem is better. # This CAN cause issues if this runs while docker is appending logs to the file. # It is possibly that if you use this, `docker logs` will throw an error due to a partial log entry being present and unparsable by docker. # Don't use this if you don't know what you're doing. LOG_PATH="$HOME/Library/Containers/com.docker.docker/Data/log/host" -
innateessence revised this gist
Sep 1, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/usr/bin/env bash # I am aware this can be handled via configuration instead. # But sometimes, a script that solves the problem is better. # This CAN cause issues if this runs while docker is appending logs to the file. # It is possibly that if you use this, `docker logs` will throw an error due to a partial log entry being present. # Don't use this if you don't know what you're doing. -
innateessence revised this gist
Aug 22, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ # It is possibly that if you use this, `docker logs` will throw an error due to a partial log entry being present. # Don't use this if you don't know what you're doing. LOG_PATH="$HOME/Library/Containers/com.docker.docker/Data/log/host" function wipe_log(){ # $1: log file path -
innateessence revised this gist
Aug 22, 2024 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ LOG_PATH='/Users/jack/Library/Containers/com.docker.docker/Data/log/host' function wipe_log(){ # $1: log file path # example usage: # wipe_log "$LOG_PATH/monitor.log.0" local log_file="$1" truncate -s 0 "$log_file" -
innateessence revised this gist
Aug 7, 2024 . 1 changed file with 1 addition and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,25 +6,20 @@ # It is possibly that if you use this, `docker logs` will throw an error due to a partial log entry being present. # Don't use this if you don't know what you're doing. LOG_PATH='/Users/jack/Library/Containers/com.docker.docker/Data/log/host' function wipe_log(){ # $1: log file path # example usage: # wipe_log "$LOG_PATH/monitor.log.0" true local log_file="$1" truncate -s 0 "$log_file" } function Main(){ for log_file in "$LOG_PATH"/* ; do wipe_log "$log_file" done du -sh "$LOG_PATH" -
innateessence created this gist
Aug 7, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ #!/usr/bin/env bash # I am aware this can be handled via configuration instead. # But sometimes, a script that solves the problem better. # This CAN cause issues if this runs while docker is appending logs to the file. # It is possibly that if you use this, `docker logs` will throw an error due to a partial log entry being present. # Don't use this if you don't know what you're doing. VERBOSE=true LOG_PATH='/Users/jack/Library/Containers/com.docker.docker/Data/log/host' function wipe_log(){ # $1: log file path # example usage: # wipe_log "$LOG_PATH/monitor.log.0" true local log_file="$1" local verbose="{2:-false}" if [ "$verbose" = true ]; then echo "Wiping log file: $log_file" fi truncate -s 0 "$log_file" } function Main(){ for log_file in "$LOG_PATH"/* ; do wipe_log "$log_file" "$VERBOSE" done du -sh "$LOG_PATH" } Main