bugy / script-server

Web UI for your scripts with execution management
Other
1.52k stars 244 forks source link

How to clean history? #694

Open lupin3rd opened 10 months ago

lupin3rd commented 10 months ago

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...

bugy commented 10 months ago

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

lupin3rd commented 10 months ago

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

bugy commented 10 months ago

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

lupin3rd commented 10 months ago

A pagination based on day ?

muzzol commented 1 week ago

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