Here: if (-e "$filename.0" && (mtime("$filename.0") > mtime("$filename.1.gz")) ) { And then, if you i.e. use bzip2 or no compression at all, the whole logtail2 exits due to exit() in mtime(), because it cannot stat an unexisting file.