I use pm2 in my server, but pm2-logrotate
consumption is so very huge.
So, I wrote this. For me, and anyone.
You can download this file in any where.(like wget, curl, etc...)
wget https://raw.githubusercontent.com/0ldm0s/py-logrotate/master/logrotate.py
You need Python 3.x for this file. you can using apt
or dnf
, also pyenv
etc.
pm2 start logrotate.py --name "py-logrotate" --time --interpreter=python --no-autorestart --cron "* * * * *"
{
name: "py-logrotate",
cwd: "in your path",
script: "logrotate.py",
interpreter: "python",
merge_logs: false,
time: true,
autorestart: false,
cron_restart: "* * * * *"
}
Thank you for use. :)