It might help to know “why” you are asking, but I can guess.
If you just want to force logs to cycle. This will rename the existing logs with ‘.old’ for the adt process:
hcicmd -p adt -c ‘. output_cycle’
We have a script that runs every night which first adds a date stamp to *.err files then cycles the logs. Basically, something like this for each process:
DATESTAMP=`date +%Y%m%d`
PROC=adt
ERRFILE=$HCISITEDIR/exec/processes/$PROC/$PROC.err
mv $ERRFILE $ERRFILE.$DATESTAMP
hcicmd -p $PROC -c ‘. output_cycle’
(Overwriting yesterday’s *.log.old is good enough for us. A cron job deletes *.err.YYYYMMDD files older than a certain age so they don’t pile up.)
If you are worried about losing messages in *.old files (which get created accidentally or automatically) you could try modifying hcienginerun to safely move or rename any existng .log and .err files before hciengine is called. Or you could make a script to rescue .log.old and .err.old files on a periodic basis. (I’ve thought about it, but never tried it.)
By the way, hciengine must be what does the re-naming (and not some script) based on the incriminating printf-style formats found in the executable and the fact that it’s the only place I could find any “.old” references.
$ strings `which hciengine` | grep old
%s.log.old
%s.err.old
Automatic cycling of output log files: eoLogFileCycleThreshold:%d kB logFileSize:%d kB errFileSize:%d kB
(Hmmm, eoLogFileCycleThreshold seems suspicious too… but I can’t recall anything about it right now.)