
ログ「4165665 May 6 18:05 auth.log.1」のように「***.1」に溜まり続ける
/var/logはtmpfsなので一杯になってもログが取れないだけやけど、気持ち悪い
logrotateをデバックモードで
# logrotate -d /etc/logrotate.conf 2>log
# less log
considering log /var/log/auth.log -->size 0
Now: 2022-05-06 18:06
Last rotated at 2022-05-01 00:00
log does not need rotating (log size is below the 'size' threshold)・・・ログをローテーションする必要はありません(ログサイズが「サイズ」のしきい値を下回っています)・・・ちなみsize 10kで設定
root@iot002:/www/remote-hand/tmp# ll /var/log/
total 6992
drwxrwxr-x 10 root root 700 May 5 00:00 ./
drwxr-xr-x 10 root root 4096 Jan 6 15:17 ../
-rw-r--r-- 1 root root 0 Oct 23 2017 alternatives.log
drwxr-xr-x 2 root root 200 May 6 00:00 apache2/
drwxr-xr-x 2 root root 80 Oct 23 2017 apt/
-rw-r----- 1 root adm 0 May 1 00:00 auth.log
-rw-r----- 1 root adm 4165665 May 6 18:05 auth.log.1
-rw-r--r-- 1 root root 0 Oct 23 2017 bootstrap.log
・
-rw-r----- 1 root adm 0 May 1 00:00 syslog
-rw-r----- 1 root adm 2665858 May 6 18:05 syslog.1
logrotateを強制
# logrotate -f /etc/logrotate.conf
-rw-r--r-- 1 root root 0 Oct 23 2017 alternatives.log
drwxr-xr-x 2 root root 200 May 6 18:12 apache2/
drwxr-xr-x 2 root root 80 Oct 23 2017 apt/
-rw-r----- 1 root adm 12385 May 6 18:35 auth.log
-rw-r----- 1 root adm 4168962 May 6 18:12 auth.log.1
-rw-r--r-- 1 root root 0 Oct 23 2017 bootstrap.log
-rw-rw---- 1 root utmp 0 May 6 18:12 btmp
-rw-rw---- 1 root utmp 1152 May 1 11:47 btmp.1
-rw-r----- 1 root adm 1194 May 6 18:33 daemon.log
-rw-r----- 1 root adm 137 May 6 18:12 daemon.log.1
drw
・
rw-r----- 1 root adm 8583 May 6 18:35 syslog
-rw-r----- 1 root adm 286 May 6 18:12 syslog.1
-rw-r----- 1 _apt adm 0 Oct 23 2017 ufw.log
-
これでいけるか