Logrotate exclude log file

Hi all !

I've an issue to exclude a log file from logrotate, I tried this below:

/var/log/apache2/[!(*logfile_in_question*)]*.log {
        olddir /var/log/apache2/old
        missingok
        rotate 50
        compress
        copytruncate
        notifempty
        create 644 root root
}

I tried also:

/var/log/apache2/[!logfile_in_question]*.log

It doesn't work.. Can someone help me please ?:slight_smile:

---------- Post updated 13-10-17 at 04:43 AM ---------- Previous update was 12-10-17 at 09:15 AM ----------

I solved my issue in adding these lines in the logrotate conf file:

        
prerotate
            bash -c "[[ ! $1 =~ log_in_question ]]"
endscript
/var/log/apache2/*.log {
        olddir /var/log/apache2/old
        rotate 50
        compress
        copytruncate
        notifempty
        create 644 root root
        prerotate
            bash -c "[[ ! $1 =~ log_in_questiong ]] && [[ ! $1 =~ log_in_question2 ]]"
        endscript
}

Bye ! :slight_smile: