0

I am facing the problem in doing the settings in

     logrotate.conf

I had done the settings once, but it didn't work accordingly.

The main condition is to rotate the log files along with compression at the interval of 5 days

 /var/log/humble/access.log
     { 

        daily
        copytruncate
        rotate 5
         create 755 humble humble
         dateext
         compress
         include /etc/logrotate.d/humble/
    }

Even after doing this, compression was stopped after days.

halfer
  • 19,824
  • 17
  • 99
  • 186
Abhishek Tripathi
  • 1,570
  • 3
  • 20
  • 32
  • You should give some more information, and some examples of what you have tried. You did not mentioned the system or server you are using. For example, i use a shell script in the linux crontab to compress the logs a remove old ones, please elaborate a bit more. – Paraíso Dec 23 '13 at 14:04
  • the changes i had done please go through once ... and please help me to resolve – Abhishek Tripathi Dec 23 '13 at 14:12

1 Answers1

0

Your logrotate.conf file should have mention to include your file "humble":-

include /etc/logrotate.d/humble

#End of Logrotate.conf

and then in your /etc/logrotate.d/humble

/var/log/humble/access.log
 { 

    daily
    copytruncate
    rotate 5
    create 755 humble humble
    dateext
    compress

}

The number specified after rotate gives how many files to be kept for backup after rotation. Here it is 5.

Also, you need to add a rule in the crontab file for triggering the logrotate every 5 days.

Rule in crontab file for running it every 5 days is :-

0 0 */5 * *
Akshay Patil
  • 954
  • 1
  • 12
  • 28