diff --git a/check_router_reboot.jl b/check_router_reboot.jl index 8e6ba9b..12ad568 100644 --- a/check_router_reboot.jl +++ b/check_router_reboot.jl @@ -270,6 +270,12 @@ end # Main loop: runs indefinitely every CHECK_INTERVAL_SECS function main_loop() + # Ensure log file exists + if !isfile(LogFilePath) + open(LogFilePath, "a") do io + # create empty file + end + end # limit log file to latest 100 events limitTextFileLines(LogFilePath; maxlines=100) thisFilePath = @__FILE__ diff --git a/check_router_reboot_log.txt b/check_router_reboot_log.txt index 10972c3..f40773e 100644 --- a/check_router_reboot_log.txt +++ b/check_router_reboot_log.txt @@ -22,3 +22,4 @@ [2026-03-11T16:27:47.181] Starting check loop. Checking router 192.168.88.1 every 60 seconds. [2026-03-11T16:30:28.572] Starting check loop. Checking router 192.168.88.1 every 60 seconds. [2026-03-11T16:43:50.213] Starting check loop. Checking router 192.168.88.1 every 60 seconds. +[2026-03-11T17:37:15.954] Starting check loop. Checking router 192.168.88.1 every 60 seconds. diff --git a/check_yiem_website_reboot.jl b/check_yiem_website_reboot.jl index e58df27..ccecfde 100644 --- a/check_yiem_website_reboot.jl +++ b/check_yiem_website_reboot.jl @@ -257,6 +257,12 @@ end # Main loop: runs indefinitely every CHECK_INTERVAL_SECS function main_loop() + # Ensure log file exists + if !isfile(LogFilePath) + open(LogFilePath, "a") do io + # create empty file + end + end # limit log file to latest 100 events limitTextFileLines(LogFilePath; maxlines=100) thisFilePath = @__FILE__