sh
This commit is contained in:
parent
3d6cfc2b49
commit
1785d45a8c
16
clean_old_logs.sh
Executable file
16
clean_old_logs.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
BASE=~/Downloads/sweeper_200/nodes_log
|
||||
KEEP_DATE=20260501
|
||||
|
||||
cd "$BASE" || exit 1
|
||||
|
||||
find . -mindepth 2 -maxdepth 2 -type d \
|
||||
| grep -E '/[0-9]{8}$' \
|
||||
| awk -F/ -v keep="$KEEP_DATE" '$3 < keep' \
|
||||
| while read dir; do
|
||||
echo "Deleting: $dir"
|
||||
rm -rf "$dir"
|
||||
done
|
||||
|
||||
echo "Cleanup complete."
|
||||
Loading…
Reference in New Issue
Block a user