Created
August 8, 2019 13:02
-
-
Save progress44/f37b0716a6676d5978001ac734bc3706 to your computer and use it in GitHub Desktop.
Revisions
-
progress44 created this gist
Aug 8, 2019 .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,18 @@ #!/bin/bash DIR=/var/lib/docker/containers FILES=$(ls $DIR) for f in $FILES do echo "Processing $f dir..." # take action on each file. $f store current file name ls -lash $DIR/$f | grep .log LOGS=$(ls $DIR/$f/ | grep .log) for l in $LOGS do echo "emptying $l logfille" echo "" > $DIR/$f/$l done done