-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogrotate.file
31 lines (30 loc) · 914 Bytes
/
logrotate.file
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# ===============================================================
# MongoDB Oplog Dump Log Rotation Configuration
# ===============================================================
# Purpose: This configuration manages the rotation of log files
# created by the MongoDB Oplog dump process
#
# Functionality:
# - Rotates logs daily
# - Keeps 7 days of log history
# - Compresses old log files (except the most recent)
# - Creates new log files with 644 permissions
# - Adds date extension to rotated files
#
# Location: /etc/logrotate.d/mongo-oplog-dump-logs
# Target logs: /mongo-oplog-dump/logs/*.log
# ===============================================================
/mongo-oplog-dump/logs/*.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 644 root root
dateext
dateformat -%Y-%m-%d
postrotate
/usr/bin/killall -HUP rsyslogd
endscript
}