Fix the logic for lshell logs rotation (2)