Adding logrotate analysis
This commit is contained in:
parent
add7cb1005
commit
ef76e0113e
36
README.md
36
README.md
|
@ -34,6 +34,42 @@ get "jbowen.dev/cereal": found meta tag get.metaImport{Prefix:"jbowen.dev/cereal
|
||||||
jbowen.dev/cereal (download)
|
jbowen.dev/cereal (download)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Sample logrotate config
|
||||||
|
|
||||||
|
Initial
|
||||||
|
|
||||||
|
```json
|
||||||
|
~/.gocustomurls/logs/app.log {
|
||||||
|
size 20M
|
||||||
|
copytruncate
|
||||||
|
compress
|
||||||
|
notifempty
|
||||||
|
delaycompress
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To fix this error
|
||||||
|
|
||||||
|
```sh
|
||||||
|
rotating pattern: /home/bloguser/.gocustomurls/logs/app.log forced from command line (no old logs will be kept)
|
||||||
|
empty log files are not rotated, old logs are removed
|
||||||
|
considering log /home/bloguser/.gocustomurls/logs/app.log
|
||||||
|
error: skipping "/home/bloguser/.gocustomurls/logs/app.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
|
||||||
|
```
|
||||||
|
|
||||||
|
do this instead
|
||||||
|
|
||||||
|
```json
|
||||||
|
~/.gocustomurls/logs/app.log {
|
||||||
|
su bloguser bloguser
|
||||||
|
size 20M
|
||||||
|
copytruncate
|
||||||
|
compress
|
||||||
|
notifempty
|
||||||
|
delaycompress
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## TODOs
|
## TODOs
|
||||||
|
|
||||||
* [x] Fix permission errors around opening the app.log and rules.json.
|
* [x] Fix permission errors around opening the app.log and rules.json.
|
||||||
|
|
Loading…
Reference in New Issue