Sort of archiving log files to delete with out affecting the PMG operation

JuanCAguilar

New Member
Feb 14, 2023
17
2
3
México
www.conafor.gob.mx
Hello good afternoon

Somebody could advise me about the kind of archiving log files that are secure to delete with out brook de harmonic PMG operation?

Which of the following could be the best candidates?

root@sagw:~# ls -l /var/log/
total 26325128
-rw-r--r-- 1 root root 24426 May 15 20:55 alternatives.log
drwxr-xr-x 2 root root 60 May 15 20:55 apt
-rw-r----- 1 root adm 25896 May 31 18:17 auth.log
-rw-r----- 1 root adm 44221 May 27 23:17 auth.log.1
-rw-r----- 1 root adm 4898 May 20 23:17 auth.log.2.gz
-rw-rw---- 1 root utmp 2688 May 17 11:00 btmp
drwxr-x--- 2 _chrony _chrony 6 May 15 19:23 chrony
drwxr-xr-x 2 clamav clamav 137 May 28 00:00 clamav
-rw-r----- 1 root adm 361824 May 31 18:16 daemon.log
-rw-r----- 1 root adm 1819236 May 28 00:01 daemon.log.1
-rw-r----- 1 root adm 97458 May 21 00:00 daemon.log.2.gz
-rw-r----- 1 root adm 0 May 21 00:00 debug
-rw-r----- 1 root adm 12412 May 15 20:56 debug.1
-rw-r--r-- 1 root root 300533 May 15 20:55 dpkg.log
-rw-r--r-- 1 root root 3616 May 15 19:22 faillog
-rw-r--r-- 1 root root 1098 May 15 19:21 fontconfig.log
drwxr-sr-x+ 3 root systemd-journal 46 May 15 19:23 journal
-rw-r----- 1 root adm 0 May 21 00:00 kern.log
-rw-r----- 1 root adm 599719 May 15 20:56 kern.log.1
-rw-rw-r-- 1 root utmp 32996 May 31 17:53 lastlog
-rw-r----- 1 root adm 127008 May 31 18:15 mail.err
-rw-r----- 1 root adm 313729 May 28 00:00 mail.err.1
-rw-r----- 1 root adm 33628 May 20 23:53 mail.err.2.gz
-rw-r----- 1 root adm 2381547394 May 31 18:23 mail.info
-rw-r----- 1 root adm 4384045742 May 28 00:01 mail.info.1
-rw-r----- 1 root adm 122453800 May 21 00:00 mail.info.2.gz
-rw-r----- 1 root adm 2381547394 May 31 18:23 mail.log
-rw-r----- 1 root adm 4384045742 May 28 00:01 mail.log.1
-rw-r----- 1 root adm 122453800 May 21 00:00 mail.log.2.gz
-rw-r----- 1 root adm 2211006543 May 31 18:22 mail.warn
-rw-r----- 1 root adm 3943494448 May 28 00:00 mail.warn.1
-rw-r----- 1 root adm 68352359 May 20 23:59 mail.warn.2.gz
-rw-r----- 1 root adm 67068 May 31 18:00 messages
-rw-r----- 1 root adm 121486 May 28 00:00 messages.1
-rw-r----- 1 root adm 98439 May 21 00:00 messages.2.gz
drwxr-xr-x 2 www-data www-data 26 May 15 19:24 pmgproxy
drwxrwxr-t 2 root postgres 68 May 21 00:00 postgresql
drwx------ 2 root root 6 May 15 19:23 private
drwxr-xr-x 3 root root 19 May 15 19:22 pve
drwxr-xr-x 3 root root 17 May 15 19:20 runit
drwxr-x--- 2 root adm 6 Aug 9 2022 samba
-rw-r----- 1 root adm 2381986272 May 31 18:23 syslog
-rw-r----- 1 root adm 4386004422 May 28 00:01 syslog.1
-rw-r----- 1 root adm 122734867 May 21 00:00 syslog.2.gz
-rw-rw-r-- 1 root utmp 19200 May 31 17:53 wtmp

Greetings

Best regards
Juan Carlos
 
The /var/log/syslog* is where the tracking center takes it's information from - so if you use that it's probably good to not delete those

/var/log/mail.(log|info|warn) should contain parts of the information that is in syslog too (assuming you did not adapt the rsyslog.conf) - and they seem pretty large - so you can consider them - as always with logfiles - I'd suggest removing the old ones (for example mail.info.1, mail.info.2.gz,...) and keep the current one in place)

apart from that - as a tip for looking where to free diskspace - I can recommend installing `ncdu` (with `apt install ncdu`) and checking with `ncdu -x /`

I hope this helps!
 
  • Like
Reactions: JuanCAguilar
The /var/log/syslog* is where the tracking center takes it's information from - so if you use that it's probably good to not delete those

/var/log/mail.(log|info|warn) should contain parts of the information that is in syslog too (assuming you did not adapt the rsyslog.conf) - and they seem pretty large - so you can consider them - as always with logfiles - I'd suggest removing the old ones (for example mail.info.1, mail.info.2.gz,...) and keep the current one in place)

apart from that - as a tip for looking where to free diskspace - I can recommend installing `ncdu` (with `apt install ncdu`) and checking with `ncdu -x /`

I hope this helps!

Thanks a lot Stoiko for your advice!

I'm going to take it in mind so acurately, ncdu is a pretty cool tool besides...

--- /var/log --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/..
4.1 GiB [##########] syslog.1
4.1 GiB [######### ] mail.log.1
4.1 GiB [######### ] mail.info.1
4.0 GiB [######### ] /journal
3.7 GiB [######## ] mail.warn.1
3.3 GiB [######## ] syslog
3.3 GiB [######## ] mail.log
3.3 GiB [######## ] mail.info
3.0 GiB [####### ] mail.warn
117.1 MiB [ ] syslog.2.gz
116.8 MiB [ ] mail.log.2.gz
116.8 MiB [ ] mail.info.2.gz
65.2 MiB [ ] mail.warn.2.gz
14.9 MiB [ ] /pmgproxy
1.7 MiB [ ] daemon.log.1
588.0 KiB [ ] kern.log.1
548.0 KiB [ ] daemon.log
312.0 KiB [ ] mail.err.1
296.0 KiB [ ] dpkg.log.1
184.0 KiB [ ] mail.err
152.0 KiB [ ] /pve
120.0 KiB [ ] messages.1
100.0 KiB [ ] messages.2.gz
96.0 KiB [ ] messages
96.0 KiB [ ] daemon.log.2.gz
44.0 KiB [ ] auth.log.1
40.0 KiB [ ] auth.log
40.0 KiB [ ] /apt
36.0 KiB [ ] mail.err.2.gz
24.0 KiB [ ] alternatives.log.1
20.0 KiB [ ] wtmp
16.0 KiB [ ] /postgresql
16.0 KiB [ ] debug.1
12.0 KiB [ ] lastlog
8.0 KiB [ ] auth.log.2.gz
8.0 KiB [ ] /clamav
4.0 KiB [ ] faillog
4.0 KiB [ ] btmp.1
4.0 KiB [ ] fontconfig.log
4.0 KiB [ ] dpkg.log
0.0 B [ ] /runit
e 0.0 B [ ] /samba
e 0.0 B [ ] /private
e 0.0 B [ ] /chrony
0.0 B [ ] kern.log
0.0 B [ ] debug
0.0 B [ ] btmp
0.0 B [ ] alternatives.log

Best regards
Juan Carlos
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!