forked from vesoft-inc/nebula-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logrotate.sh
51 lines (46 loc) · 1.43 KB
/
logrotate.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/env bash
ROTATE=5
SIZE=200M
if [ -n "${LOGROTATE_ROTATE}" ]; then
ROTATE=${LOGROTATE_ROTATE}
fi
if [ -n "${LOGROTATE_SIZE}" ]; then
SIZE=${LOGROTATE_SIZE}
fi
nebula="
/usr/local/nebula/logs/graphd-stderr.log
/usr/local/nebula/logs/graphd-out.log
/usr/local/nebula/logs/nebula-graphd.INFO
/usr/local/nebula/logs/nebula-graphd.INFO.impl
/usr/local/nebula/logs/nebula-graphd.WARNING
/usr/local/nebula/logs/nebula-graphd.WARNING.impl
/usr/local/nebula/logs/nebula-graphd.ERROR
/usr/local/nebula/logs/nebula-graphd.ERROR.impl
/usr/local/nebula/logs/metad-stderr.log
/usr/local/nebula/logs/metad-out.log
/usr/local/nebula/logs/nebula-metad.INFO
/usr/local/nebula/logs/nebula-metad.INFO.impl
/usr/local/nebula/logs/nebula-metad.WARNING
/usr/local/nebula/logs/nebula-metad.WARNING.impl
/usr/local/nebula/logs/nebula-metad.ERROR
/usr/local/nebula/logs/nebula-metad.ERROR.impl
/usr/local/nebula/logs/storaged-stderr.log
/usr/local/nebula/logs/storaged-out.log
/usr/local/nebula/logs/nebula-storaged.INFO
/usr/local/nebula/logs/nebula-storaged.INFO.impl
/usr/local/nebula/logs/nebula-storaged.WARNING
/usr/local/nebula/logs/nebula-storaged.WARNING.impl
/usr/local/nebula/logs/nebula-storaged.ERROR
/usr/local/nebula/logs/nebula-storaged.ERROR.impl
{
daily
rotate ${ROTATE}
copytruncate
nocompress
missingok
notifempty
create 644 root root
size ${SIZE}
}
"
echo "${nebula}" >/etc/logrotate.d/nebula