Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 573  / 3 Years ago, sat, june 12, 2021, 4:36:06

In /var/log/apt, I am seeing:



$ /var/log/apt $ ls -l
total 100
-rw-r--r-- 1 root root 3343 Feb 14 22:34 history.log
-rw-r--r-- 1 root root 2156 Jan 31 06:03 history.log.1.gz
-rw-r--r-- 1 root root 1288 Dec 31 11:14 history.log.2.gz
-rw-r--r-- 1 root root 3232 Nov 27 07:22 history.log.3.gz
-rw-r--r-- 1 root root 18813 Oct 31 07:11 history.log.4.gz
-rw-r----- 1 root adm 20475 Feb 14 22:34 term.log
-rw-r----- 1 root adm 4862 Jan 31 06:03 term.log.1.gz
-rw-r----- 1 root adm 3685 Dec 31 11:14 term.log.2.gz
-rw-r----- 1 root adm 9058 Nov 27 07:22 term.log.3.gz
-rw-r----- 1 root adm 12452 Oct 31 07:11 term.log.4.gz


It looks like history.log is being archived once a month.



Because history.log and its archives are important to me, I want to know:




  • how many archives will be stored before the oldest is deleted?

  • where is this information located?

  • can I change the settings to increase the number of logs stored? (Going from the file sizes and my usage of apt-get, I am not concerned about disk space.)



Thank you.


More From » apt

 Answers
3

Useful information is in /etc/logrotate.d. To see how logs relating to apt are handled, look at /etc/logrotate.d/apt. On my system, I see:



$ /etc/logrotate.d $ cat apt
/var/log/apt/term.log {
rotate 12
monthly
compress
missingok
notifempty
}

/var/log/apt/history.log {
rotate 12
monthly
compress
missingok
notifempty
}


And, according to http://manpages.ubuntu.com/manpages/saucy/man8/logrotate.8.html, rotate 12 would mean that logrotate would be run twelve times at monthly intervals before the oldest archive is deleted.



Obviously then, editing /etc/logrotate.d/apt to modify rotate 12 to a desired value is the solution in this case.


[#26999] Sunday, June 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bleger

Total Points: 468
Total Questions: 108
Total Answers: 100

Location: Belarus
Member since Wed, Dec 7, 2022
1 Year ago
bleger questions
Wed, Mar 1, 23, 03:00, 1 Year ago
Mon, Feb 6, 23, 14:44, 1 Year ago
Wed, Dec 29, 21, 13:59, 2 Years ago
;