Jump to content
KMO

log file to become large and take up drive space in Tinker Edge R Debian 10 V2.0.5

Recommended Posts

Hello everyone,

The logrotate.timer does not work cyclically in Tinker Edge R Debian 10 V2.0.5. This problem causes the log file to become large and take up drive space.

On this OS, logrotate is executed by systemd, not cron.

I understand that the essence of the problem is that logrotate.timer is not enabled.

$ systemctl status logrotate.timer
* logrotate.timer - Daily rotation of log files
   Loaded: loaded (/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled)
   Active: inactive (dead)
  Trigger: n/a
     Docs: man:logrotate(8)
           man:logrotate.conf(5)

Looking at the configuration file, the timer should run once a day.

$ systemctl cat logrotate.timer 
# /lib/systemd/system/logrotate.timer
[Unit]
Description=Daily rotation of log files
Documentation=man:logrotate(8) man:logrotate.conf(5)

[Timer]
OnCalendar=daily
AccuracySec=12h
Persistent=true

[Install]
WantedBy=timers.target

It appears in the timer list, but there is no execution history.

$ systemctl list-timers 
NEXT LEFT LAST                         PASSED    UNIT                         ACTIVATES
n/a  n/a  n/a                          n/a       anacron.timer                anacron.service
n/a  n/a  n/a                          n/a       apt-daily-upgrade.timer      apt-daily-upgrade.service
n/a  n/a  n/a                          n/a       apt-daily.timer              apt-daily.service
n/a  n/a  n/a                          n/a       fstrim.timer                 fstrim.service
n/a  n/a  n/a                          n/a       logrotate.timer              logrotate.service

I have tried start logrotate.timer, but this command never completes.

$ sudo systemctl start logrotate.timer

I have confirmed that logrotate can be run manually.

$ sudo /usr/sbin/logrotate -v /etc/logrotate.conf

There is an option to edit /etc/cron.daily/logrotate to ignore the systemd timer and run logrotate in cron, but I consider this a last resort.

Could anyone please share the steps to start logrotate.timer? Thank you in advance for your assistance.

Share this post


Link to post
Share on other sites

hello @KMO

On 5/26/2023 at 2:51 PM, KMO said:

The logrotate.timer does not work cyclically in Tinker Edge R Debian 10 V2.0.5. This problem causes the log file to become large and take up drive space.

 

you can get it working properly by removing the ntp package:

sudo apt-get remove ntp

if you do not wish to remove ntp, you can comment out the line below in /lib/systemd/system/systemd-timesyncd.service.d/disable-time-daemon.conf

# ConditionFileIsExecutable=!/usr/sbin/ntpd

reboot and then update the system with

sudo apt-get update

check jobs with:

systemctl list-jobs

 

Share this post


Link to post
Share on other sites
17 hours ago, tooz said:

hello @KMO

you can get it working properly by removing the ntp package:


sudo apt-get remove ntp

if you do not wish to remove ntp, you can comment out the line below in /lib/systemd/system/systemd-timesyncd.service.d/disable-time-daemon.conf


# ConditionFileIsExecutable=!/usr/sbin/ntpd

reboot and then update the system with


sudo apt-get update

check jobs with:


systemctl list-jobs

 

@tooz

Thanks for your replay.

I was able to solve the problem by removing the ntp package.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...