HistoryPurge: Clearing 219 old commits

This commit is contained in:
xpk
2024-10-24 23:09:21 +08:00
commit d08b7cac59
348 changed files with 376141 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# echo 'create table access(timestamp int, cpu float, vhost varchar(128), method varchar(4), url varchar(128));' | sqlite3 apache-access.db
read -r cpu vhost method url <<< $(apachectl fullstatus | egrep '(GET|POST|HEAD)' | sort -k5 -nr | head -1 | awk '{print $5,$13,$14,$15}')
echo "insert into access values(DATETIME('now'), $cpu, \"$vhost\", \"$method\", \"$url\");" | sqlite3 apache-access.db
sqlite3 -header -column apache-access.db "select * from access where cpu > 20 order by timestamp desc limit 10;"