My uwsgi.log path: /root/code/script/uWSGI.log
My logrotate about uwsgi configuration:
in /etc/logrotate.d/uwsgi
/root/code/script/uWSGI.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 640 root root
sharedscripts
postrotate
touch /root/code/script/.touchforlogrotate
endscript
}
My uwsgi.ini
[uwsgi]
http = 0.0.0.0:8050
socket=/root/code/script/uwsgi.sock
master=true
chdir=/root/code/
wsgi-file=/root/code/data_analysis/wsgi.py
home = /root/anaconda3/envs/data-analysis
worker=6
threads=2
max-requests=5000
thunder-lock=true
enable-threads=true
pidfile=/root/code/script/uwsgi.pid
touch-logreopen = /root/code/script/.touchforlogrotate
when i use logrotate -d /etc/logrotate.d/uwsgi
command, the following error occurs
reading config file uwsgi
error: uwsgi:2 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:3 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:4 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:5 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:6 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:7 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:8 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:9 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:10 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:11 lines must begin with a keyword or a filename (possibly in double quotes)
error: uwsgi:12 lines must begin with a keyword or a filename (possibly in double quotes)
Reading state from file: /var/lib/logrotate/status
Allocating hash table for state file, size 64 entries
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Creating new state
Handling 1 logs
rotating pattern: /root/code/script/uWSGI.log 1048576 bytes (no old logs will be kept)
empty log files are rotated, old logs are removed
considering log /root/code/script/uWSGI.log
Creating new state
Now: 2024-08-16 17:17
Last rotated at 2024-08-16 17:00
log needs rotating
rotating log /root/code/script/uWSGI.log, log->rotateCount is 0
dateext suffix '-20240816'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /root/code/script/uWSGI.log.1 to /root/code/script/uWSGI.log.2 (rotatecount 1, logstart 1, i 1),
renaming /root/code/script/uWSGI.log.0 to /root/code/script/uWSGI.log.1 (rotatecount 1, logstart 1, i 0),
log /root/code/script/uWSGI.log.2 doesn't exist -- won't try to dispose of it
renaming /root/code/script/uWSGI.log to /root/code/script/uWSGI.log.1
disposeName will be /root/code/script/uWSGI.log.1
removing old log /root/code/script/uWSGI.log.1
error: error opening /root/code/script/uWSGI.log.1: No such file or directory
I wrote this configuration file after searching the relevant information of logrotate on the Internet, but I can’t find the relevant document that reported the error now, may I ask if there is any problem with my configuration? How should it be modified?