in reply to
Re^2: Close a file and reopen a new one at midnight
in thread Close a file and reopen a new one at midnight
- You now should have updated the $hrmin and $ymd variables.
- You still have a problem if no data is received at '1228'.
- You still have a problem overwriting a file if this gets restarted.
- There are also options out there that handle this for you (one that is log4j-like, one that is tied, listed below by clueless_newbie, and probably others). See FileRotate for some options.