Run if there are enough place
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
This commit is contained in:
parent
ce361c6819
commit
e415800508
|
@ -1,3 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Juin 2022 : #64088
|
# Juin - Decembre 2022 : #64088
|
||||||
/usr/bin/sqlite3 /var/lib/fail2ban/fail2ban.sqlite3 "DELETE FROM bans WHERE date('now', '-{{ fail2ban_recidive_bantime | default(default_dbpurgeage.stdout) }}') > datetime(timeofban, 'unixepoch'); VACUUM;"
|
# Purge pour Stretch et Buster
|
||||||
|
|
||||||
|
place_dispo=$( df -h /var/lib/fail2ban/fail2ban.sqlite3 --output="avail" -h --block-size=1 |tail -n1 )
|
||||||
|
place_pris=$( echo "$(stat --format %s /var/lib/fail2ban/fail2ban.sqlite3 ) * 2" |bc )
|
||||||
|
|
||||||
|
if [ $place_pris -lt $place_dispo ]
|
||||||
|
then
|
||||||
|
/usr/bin/ionice -c3 /usr/bin/sqlite3 /var/lib/fail2ban/fail2ban.sqlite3 "DELETE FROM bans WHERE datetime('now', '-{{ fail2ban_recidive_bantime | default(default_dbpurgeage.stdout) }} second') > datetime(timeofban, 'unixepoch'); VACUUM;"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue