Checking for a log file before executing rename($old, $file) to avoid system errors reported