4 lines
355 B
Bash
4 lines
355 B
Bash
|
sudo sed -i 's/-SIGUSR1/-USR1/g' /etc/logrotate.d/orbit
|
||
|
line_num=`grep '/var/log/mongodb/\*.log' /etc/logrotate.d/orbit -n | cut -d : -f 1`
|
||
|
end_num_plus=`cat /etc/logrotate.d/orbit | awk '{if (NR>='$line_num') print}'|grep '}' -n|cut -d : -f 1`
|
||
|
sudo sed -i $line_num,+$((end_num_plus-1))'s/copytruncate/create 644 mongodb mongodb/g' /etc/logrotate.d/orbit
|