Check timestamp and size of inputfile before reopen
Add params; -pid_file, -loop_max, -loop_no_change
Fix loop_max