SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
Список вопросов ПечатьМетки: directadmin логирование apache logrotate
| RemiZOffAlex Создано: 2018-03-23 07:49:29.111537 Обновлено: 2018-03-23 07:49:29.111537 |
|---|
# Ротация логов для сайтов
cat <<EOF > /usr/local/directadmin/data/templates/custom/apache.logrotate
/var/log/httpd/*_log
/var/log/httpd/*.log
/var/log/httpd/*.bytes
/var/log/httpd/domains/*.log
{
missingok
size 100M
nodateext
compress
notifempty
sharedscripts
postrotate
/bin/kill -HUP \`cat /var/run/httpd.pid 2>/dev/null\` 2> /dev/null || true
endscript
}
EOF
cp /usr/local/directadmin/data/templates/custom/apache.logrotate /etc/logrotate.d/apache
cat <<EOF >> /etc/crontab
*/5 * * * * root /etc/cron.daily/logrotate
EOF
|