I have a service in **/etc/systemd/sysem/horses.service**
[Unit]
Description=Description for sample script goes here
After=rc-local.service
[Service]
Type=simple
ExecStart=/opt/horses/startSanic2.sh
TimeoutStartSec=0
Environment="REDIS_HOST=192.168.150.220"
Environment="REDIS_PORT=6379"
[Install]
WantedBy=default.target
It runs the shell script with this code:
#!/bin/bash
gunicorn horses.server:app --bind 0.0.0.0:9000 --worker-class sanic.worker.GunicornWorker --reload
I succesfully run it and I can see the logs of the service are being written and can be read from:
journalctl -u horses.service
if I run that command - I can see all events which that horses.service logs.
I do not have any experience with logs for systemd services. My very big concern is that because this service will be running all the time - is it possible for example to set to keep the information (logs) in journalctl -u horses.service only for example for last 10 days, or to define some round logging or whatever method is suggested in order to be sure that my logs will not be full because I do want to end with my whole disk (partition) full. Please suggest me how I can limit the logs.
Thank you in advance!!!!!!!