log rotation files are not being kept in the logs directory

Version 1.225


When the number of log files in the logs directory is checked, the index pointer is initialized to 0 to show that the index has not yet been set, but index 0 is a valid value, thus if index at position 0 is tagged to be deleted due to age, the next loop around will think that no file has yet been set to the next file will be tagged, regardless of it it isn't the actual value to be deleted (probably the newer file), thus new files are deleted.

Interested to try DirectAdmin? Get a 30-day Free Trial!