script-server icon indicating copy to clipboard operation
script-server copied to clipboard

Logging file creation

Open oron89 opened this issue 2 years ago • 1 comments

Hello @bugy and all,

I saw this logging configuration - https://github.com/bugy/script-server/wiki/Server-configuration#--execution_file

Each execution is always written to a separate file

However, is there any way to change the frequency of file creation without editing the base code? For example, file creation by a combination of script name and day (log file per script per day, instead of log file per execution).

Thank you!

oron89 avatar Feb 07 '23 11:02 oron89

This may be easier to do by way of a crontab that runs just after midnight each day...

#!/bin/bash
cd /path/to/your/scriptserver/logs

ydate=`date -d "yesterday" +"%y%m%d"`
logfile="Scriptserver-unified-${ydate}.log"; rm ${logfile}

for logfile in `ls -tr *${ydate}*.log`; do cat $i >> ${logfile} && rm $i; done

Then we could either add ${logfile} to the list of files parsed for display by the UI, or you can write another script to find those files, and load it into Scriptserver to display those files.

MNeill73 avatar Feb 07 '23 17:02 MNeill73