Increase visibility into IT operations to detect and resolve technical issues before they impact your business.

Learn More Go to Insights

Engage with our Red Hat Product Security team, access security updates, and ensure your environments are not exposed to any known security vulnerabilities. Product Security Center

Keep your systems secure with Red Hat's specialized responses to security vulnerabilities. View Responses

Will the parameters function as follows :

Understanding 1 - This function will copy the current *.log file to *.log1 and compress it to *.log1.gz then will make the current running *.log file as Zero byte by nullifying it.

Understanding 2 - This function will move the current *.log file to *.log1 and compress it to *.log1.gz then createa new *.log file which is zero byte

Meaning of following logrotate parameters as per man logrotate.conf :

ifempty : Rotate the log file even if it is empty, overriding the notifempty option (ifempty is the default).

missingok : If the log file is missing, go on to the next one without issuing an error message.

noolddir : Logs are rotated in the same directory the log normally resides in (this overrides the olddir option).

daily : Log files are rotated every day.

compress : Old versions of log files are compressed with gzip(1) by default.

copytruncate : Truncate the original log file in place after creating a copy, instead of moving the old log file and optionally creating a new one. It can be used when some program cannot be told to close its logfile and thus might continue writing (appending) to the previous log file forever.Note that there is a very small time slice between copying the file and truncating it, so some logging data might be lost.When this option is used, the create option will have no effect, as the old log file stays in place.

rotate 40 : Log files are rotated count times before being removed or mailed to the address specified in a mail directive. If count is 0, old versions are removed rather than rotated. Here , count is 40.

Will the parameters function as follows :

Understanding 1 - This function will copy the current *.log file to *.log1 and compress it to *.log1.gz then will make the current running *.log file as Zero byte by nullifying it.

Understanding 2 - This function will move the current *.log file to *.log1 and compress it to *.log1.gz then create a new *.log file which is zero byte

Since , copytruncate is being used the first (Understanding 1 ) is correct. As copytruncate truncates the original log file in place after creating a copy , instead of moving old log file and optionally creating a new one.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Here are the common uses of Markdown.

Code blocks
~~~
Code surrounded in tildes is easier to read
        
Links/URLs
[Red Hat Customer Portal](https://access.redhat.com)
Learn more Are you sure you want to request a translation? We appreciate your interest in having Red Hat content localized to your language. Please note that excessive use of this feature could cause delays in getting specific content you are interested in translated.