Skip to content

Commit

Permalink
revise logrotate cron to create log directory if it doesn't exist.
Browse files Browse the repository at this point in the history
also sets ownership regardless
  • Loading branch information
pb66 authored May 15, 2019
1 parent 85ec9ce commit c391e4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/logger/logrotate
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate -v -s /var/log/logrotate/logrotate.status /etc/logrotate.conf 2>&1 | tee /var/log/logrotate/logrotate.log
mkdir -p /var/log/logrotate && chown root:root /var/log/logrotate
/usr/sbin/logrotate -v -s /var/log/logrotate/logrotate.status /etc/logrotate.conf >> /var/log/logrotate/logrotate.log 2>&1

0 comments on commit c391e4e

Please sign in to comment.