private boolean initRetryTask(TaskProfile profile) {
        String dataTimeFrom = profile.get(TaskConstants.FILE_TASK_TIME_FROM, "");
        String dataTimeTo = profile.get(TaskConstants.FILE_TASK_TIME_TO, "");
        try {
            startTime = DateTransUtils.timeStrConvertToMillSec(dataTimeFrom, profile.getCycleUnit());
            endTime = DateTransUtils.timeStrConvertToMillSec(dataTimeTo, profile.getCycleUnit());
        } catch (ParseException e) {
            LOGGER.error("retry task time error start {} end {}", dataTimeFrom, dataTimeTo, e);
            return false;
        }
        return true;
    }
Watch directory, if new valid files are created, create instance correspondingly.
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/task/logcollection/local/FileTask.java