Saturday, November 26, 2016

Troubleshooting logrotate and cron on Ubuntu server

My client's logrotate was not rotate the logs for months. However, manually run logrotate is fine. use debug, verbose, even force options can't find anything funny. The content of /var/lib/logrotate/status looks normal. Finally, check the cron job to see if anything wrong there.
  1. Tail /var/log/cron.log and see "Authentication token is no longer valid; new one required".
  2. Run "chage -l root" to check the aging information of root account, and "password must be changed" message shown up.
  3. Generate a new password from https://strongpasswordgenerator.com, then run passwd command to change to the new passwd for root. 
  4. Check /var/log/cron.log again after a cron job is executed, and the cron.log seems OK. The problem fixed.
Conclusion: Since the cron job is essential for automatic log rotation. If cron job has any problem, the log files don't get rotated even manual run has no problem at all.  


1 comment:

abbiegailjackson said...

Borgata Hotel Casino & Spa - Mapyro
The Borgata Hotel Casino & Spa is 시흥 출장안마 a 정읍 출장샵 4-minute drive 서울특별 출장마사지 from Borgata Hotel Casino & Spa, and 2 minutes from Garden Arena. The casino features 세종특별자치 출장마사지 10 논산 출장안마 gaming tables,