Skip to content

Commit ba7942c

Browse files
committed
Adjust logrotate and fix mail log tail on new installations
1 parent 906be87 commit ba7942c

File tree

12 files changed

+48
-8
lines changed

12 files changed

+48
-8
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
#!/bin/sh
2+
if [ ! -f /var/log/mail.log ]; then
3+
touch /var/log/mail.log
4+
chown root:adm /var/log/mail.log
5+
chmod 640 /var/log/mail.log
6+
fi
27
/usr/bin/tail -f /var/log/mail.log

7.4-nginx/conf/logrotate.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/var/www/logs/*.log {
22
daily
3+
copytruncate
34
missingok
4-
rotate 3
5+
rotate 7
56
compress
67
delaycompress
78
notifempty
8-
create 0640 www-data adm
99
sharedscripts
1010
prerotate
1111
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
#!/bin/sh
2+
if [ ! -f /var/log/mail.log ]; then
3+
touch /var/log/mail.log
4+
chown root:adm /var/log/mail.log
5+
chmod 640 /var/log/mail.log
6+
fi
27
/usr/bin/tail -f /var/log/mail.log
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
#!/bin/sh
2+
if [ ! -f /var/log/mail.log ]; then
3+
touch /var/log/mail.log
4+
chown root:adm /var/log/mail.log
5+
chmod 640 /var/log/mail.log
6+
fi
27
/usr/bin/tail -f /var/log/mail.log

8.0-nginx/conf/logrotate.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/var/www/logs/*.log {
22
daily
3+
copytruncate
34
missingok
4-
rotate 3
5+
rotate 7
56
compress
67
delaycompress
78
notifempty
8-
create 0640 www-data adm
99
sharedscripts
1010
prerotate
1111
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
#!/bin/sh
2+
if [ ! -f /var/log/mail.log ]; then
3+
touch /var/log/mail.log
4+
chown root:adm /var/log/mail.log
5+
chmod 640 /var/log/mail.log
6+
fi
27
/usr/bin/tail -f /var/log/mail.log
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
#!/bin/sh
2+
if [ ! -f /var/log/mail.log ]; then
3+
touch /var/log/mail.log
4+
chown root:adm /var/log/mail.log
5+
chmod 640 /var/log/mail.log
6+
fi
27
/usr/bin/tail -f /var/log/mail.log

8.1-nginx/conf/logrotate.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/var/www/logs/*.log {
22
daily
3+
copytruncate
34
missingok
4-
rotate 3
5+
rotate 7
56
compress
67
delaycompress
78
notifempty
8-
create 0640 www-data adm
99
sharedscripts
1010
prerotate
1111
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
#!/bin/sh
2+
if [ ! -f /var/log/mail.log ]; then
3+
touch /var/log/mail.log
4+
chown root:adm /var/log/mail.log
5+
chmod 640 /var/log/mail.log
6+
fi
27
/usr/bin/tail -f /var/log/mail.log
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
#!/bin/sh
2+
if [ ! -f /var/log/mail.log ]; then
3+
touch /var/log/mail.log
4+
chown root:adm /var/log/mail.log
5+
chmod 640 /var/log/mail.log
6+
fi
27
/usr/bin/tail -f /var/log/mail.log

0 commit comments

Comments
 (0)