Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 19c1ebed18 | |||
| 2dd3542ff9 |
@@ -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__
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user