2 Commits

Author SHA1 Message Date
19c1ebed18 update 2026-03-11 21:04:48 +07:00
2dd3542ff9 add create log file 2026-03-11 20:35:23 +07:00
3 changed files with 16 additions and 1 deletions

View File

@@ -9,7 +9,7 @@
# ------------------------------------------------------------------------------------------------ #
# *** juliar is root's julia (sudo crontab -e) but I symlinked to juliar because I want to seperate it from user's julia
# @reboot /usr/local/bin/juliar /home/ton/docker-programs/check_and_reboot/check_router_reboot.jl >> /var/log/check_reboot.log 2>&1
# @reboot /root/.juliaup/bin/julia /root/docker-apps/check_and_reboot/check_router_reboot.jl >> /var/log/check_reboot.log 2>&1
using Dates, Printf, JSON
@@ -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__

View File

@@ -22,3 +22,6 @@
[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.
[2026-03-11T20:38:46.720] Starting check loop. Checking router 192.168.88.1 every 60 seconds.
[2026-03-11T20:50:40.732] Starting check loop. Checking router 192.168.88.1 every 60 seconds.

View File

@@ -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__