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

How to clean history?

Open lupin3rd opened this issue 2 years ago • 6 comments

Hi, i have a lot of script that run scheduled and then i have a very big history in home page... then my history run very slow... How can i clean the history entry after some days?

I think that history page pagination can solve all problems...

lupin3rd avatar Sep 05 '23 09:09 lupin3rd

Hi @lupin3rd unfortunately there is no automated solution here On a demo website, i just delete log files every month, which were modified more than 5 days ago

bugy avatar Sep 05 '23 10:09 bugy

Thank you for the quickly reply :-) A simple pagination in the UI can be a good solution.

lupin3rd avatar Sep 05 '23 11:09 lupin3rd

The problem is not that easy to solve, unfortunately. Thle pagination in the UI can be a good solution.e log page is based on log files, i.e. script server has to parse each file anyways, in order to recognize to which page it belongs. I guess this is the main performance bottleneck And it will become even more critical, when adding a server-side search functionality

bugy avatar Sep 05 '23 11:09 bugy

A pagination based on day ?

lupin3rd avatar Sep 05 '23 12:09 lupin3rd

create this file /etc/logrotate.d/scriptserver with this content:

# adjust path and rotation days
# if you want to keep logs forever leave 36500 for 100 years of logs
/opt/script-server/logs/processes/*.log
{
    missingok
    daily
    rotate 36500
    compress
}

there's a lot more options you can setup for logrotate, just take a look at docs if you have other requirements. https://linux.die.net/man/8/logrotate

muzzol avatar Jul 01 '24 10:07 muzzol