Tezos_base_unix.Daily_file_rotationShared utilities for daily file rotation.
Provides date-stamped filename generation, date-based file matching, and old file cleanup used by both the log sink and profiling backends.
val current_day : unit -> daycurrent_day () returns today's date.
val day_of_ptime : Ptime.t -> dayday_of_ptime t extracts the calendar date from a Ptime.t.
val string_of_day : day -> stringstring_of_day day formats a day as "YYYYMMDD".
filename_insert_before_ext ~path s inserts s before the file extension in path. E.g. filename_insert_before_ext ~path:"node.log" "20260323" returns "node-20260323.log".
check_file_format_with_date base_filename candidate returns true if candidate matches the pattern {name}-YYYYMMDD{.ext} derived from base_filename.
list_rotation_files base_path lists files in the directory of base_path that match the dated rotation pattern.
remove_older_files base_path ~days_kept removes dated rotation files beyond the days_kept most recent ones. Synchronous.
list_rotation_files_lwt base_path is the Lwt variant of list_rotation_files.
remove_older_files_lwt base_path ~days_kept is the Lwt variant of remove_older_files.