Rotates a log file. (version 4.78 or later)

logrotate 'size' '<size>'
logrotate 'rotate' <count>
logrotate 'halt'


'size' <size>
When a log file size is over <size> byte, the log file is be rotated.
The <size> value must be larger than 128.
If the <size> is followed by K, the size is assumed to be in kilobytes. If the M is used, the size is in megabytes.
'rotate' <count>
Log files are rotated <count> times before being removed.
The <count> value must be larger than 1.
The log rotation is stopped.


  1. A log file must be opened previously.
  2. This command only configure the log rotation. So, the rotation does not be executed immediately.


; Open log
getspecialfolder str "MyDocuments"
changedir str
logopen 'teraterm_sample.log' 0 0

; Start log rotation
logrotate 'size' '32K'
logrotate 'rotate' 3

pause 600
; Stop log rotation
logrotate 'halt'

pause 600

; Close log

See also