/var/log

줄여봅시다.

ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF

우분투

확인

 du -hd 1 /var/log

/var/log/journal

/var/log/journal 오래 켜놓을 수록 크기가 커진다. 기본적으로 계속 커진다.

/var/log$ sudo du -hd 1
4.1G    ./journal
180K    ./apt
44K     ./samba
20K     ./letsencrypt

4.1G 아니 뭐 이런 개*@!@#

/etc/systemd/journald.conf 파일을 수정하여, 한계 크기를 설정하자.

SystemMaxUse=20M

디스크 사용량 보기

journalctl --disk-usage
Archived and active journals take up 80.0M in the file system.

자세한 설정은 참조

변경 후 재시작

 systemctl restart systemd-journald

Nginx

접근 로그는 nginx.conf에서 설정하는 것이 편하다.

access_log off;

에러 로그도 끌 수 있다.

error_log off;

Samba

삼바 (Samba)/etc/samba/smb.conf에서 글로벌 섹션에 로그레벨을 0(안함) 으로 설정.

설정참고.

  [global]
  # Sets the amount of log/debug messages that are sent to the log file. 0 is none, 3 is consi>
  log level = 0

그리고 삼바 재시작

  service smbd restart

Certbot

Let's encrypt은 자동으로 매일 2회 갱신을 시도하는데, 갱신기한이 1개월 남았을 때만 실제로 갱신이 이루어지므로 하루 두번은 불필요하다고 생각되면, 변경하자.

/etc/cron.d/certbot파일을 수정한다.

매월 1일로 변경

0 0 1 * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew

ubuntu-advantage

우분투 유료 서비스를 관리하는 패키지인데, 사용하지 않더라도 삭제하는 것은 권장하지 않는다. 로깅만 막자.

/etc/ubuntu-advantage/uaclient.conf

log_level: debug

off로 변경

  log_level: off

그리고

 ua refresh

cron

참조

  • Go to the /etc/pam.d directory.
  • Open the file common-session-noninteractive in an editor.
  • Look for the following line:
session required        pam_unix.so
  • Above this line, add the following:
session     [success=1 default=ignore] pam_succeed_if.so service in cron quiet use_uid
  • Save the file and exit.
  • Restart crond using something like
service cron restart

프록스목스

pveproxy

::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:07 +0900] "GET /api2/json/cluster/resources HTTP/1.1" 200 870
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:10 +0900] "GET /api2/json/cluster/tasks HTTP/1.1" 200 1009
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:11 +0900] "GET /api2/json/nodes/play/status HTTP/1.1" 200 761
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:11 +0900] "GET /api2/json/cluster/resources HTTP/1.1" 200 858
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:14 +0900] "GET /api2/json/cluster/tasks HTTP/1.1" 200 1024
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:15 +0900] "GET /api2/json/cluster/resources HTTP/1.1" 200 857
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:17 +0900] "GET /api2/json/nodes/play/status HTTP/1.1" 200 755
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:18 +0900] "GET /api2/json/cluster/tasks HTTP/1.1" 200 1024
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:19 +0900] "GET /api2/json/cluster/resources HTTP/1.1" 200 857
::ffff:192.168.0.253 - root@pam [22/11/2022:23:33:22 +0900] "GET /api2/json/cluster/tasks HTTP/1.1" 200 1024

역링크