Adjust logrotation configuration file '/etc/logrotate.d/pure-ftpd-common'.
This commit is contained in:
parent
1c2b647979
commit
bd4fa5f733
@ -308,6 +308,62 @@ else
|
|||||||
echo_failed
|
echo_failed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echononl " Renew logrotation file '/etc/logrotate.d/pure-ftpd-common'"
|
||||||
|
if [[ -f "/etc/logrotate.d/pure-ftpd-common" ]] ; then
|
||||||
|
mv "/etc/logrotate.d/pure-ftpd-common" "/root/etc_logrotate.d_pure-ftpd-common.ORIG"
|
||||||
|
|
||||||
|
pure_ftpd_control="$(which pure-ftpd-control)"
|
||||||
|
if [[ -x "$pure_ftpd_control" ]] ; then
|
||||||
|
cat << EOF > /etc/logrotate.d/pure-ftpd-common
|
||||||
|
#
|
||||||
|
# logrotate configuration file for pure-ftpd debian packages
|
||||||
|
#
|
||||||
|
# Copyright 2003,2004 by Stefan Hornburg (Racke) <racke@linuxia.de>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public
|
||||||
|
# License along with this program; if not, write to the Free
|
||||||
|
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
|
# MA 02111-1307 USA.
|
||||||
|
|
||||||
|
/var/log/pure-ftpd/ftp.log
|
||||||
|
/var/log/pure-ftpd/transfer.log {
|
||||||
|
weekly
|
||||||
|
missingok
|
||||||
|
rotate 7
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
/usr/sbin/pure-ftpd-control restart >/dev/null
|
||||||
|
endscript
|
||||||
|
notifempty
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
if [[ $? -eq 0 ]] ; then
|
||||||
|
echo_ok
|
||||||
|
else
|
||||||
|
echo_failed
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo_skipped
|
||||||
|
warn "'pure-ftpd-control' not found"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo_failed
|
||||||
|
error "No logrotation configuration /etc/logrotate.d/pure-ftpd-common found!"
|
||||||
|
fi
|
||||||
|
|
||||||
echononl " Restart syslog daemon (rsyslog)"
|
echononl " Restart syslog daemon (rsyslog)"
|
||||||
if $systemd_exists ; then
|
if $systemd_exists ; then
|
||||||
systemctl restart rsyslog > /dev/null 2> $tmp_err_msg
|
systemctl restart rsyslog > /dev/null 2> $tmp_err_msg
|
||||||
|
Loading…
Reference in New Issue
Block a user