forked from hummypkg/webif
Use manage_logs to rotate log file
This commit is contained in:
parent
1d243c989b
commit
fb9fb6ca85
@ -10,13 +10,12 @@ proc ::auto::loginit {} {
|
|||||||
# Rotate log file if large enough.
|
# Rotate log file if large enough.
|
||||||
if {[file exists $::auto::logfile] &&
|
if {[file exists $::auto::logfile] &&
|
||||||
[file size $::auto::logfile] > $logsize} {
|
[file size $::auto::logfile] > $logsize} {
|
||||||
set tstamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}]
|
exec /mod/webif/lib/bin/manage_logs
|
||||||
file rename -force $::auto::logfile "/mod/tmp/auto.$tstamp.log"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Open log file
|
# Open log file
|
||||||
if {$::auto::logfd eq "unset"} {
|
if {$::auto::logfd eq "unset"} {
|
||||||
set ::auto::logfd [open "/mod/tmp/auto.log" "a+"]
|
set ::auto::logfd [open $::auto::logfile "a+"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user