Created
November 4, 2017 19:01
-
-
Save rtrouton/d70f9d6747a00e5f5607f55b2edcb647 to your computer and use it in GitHub Desktop.
Adding logrotate configuration for Jamf Infrastructure Manager logs to /etc/logrotate.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Configure logrotate to rotate the | |
# Jamf Infrastructure Manager logs | |
# on a weekly basis | |
# Write JIM log configuration into /etc/logrotate.conf | |
if [[ -f /etc/logrotate.conf ]]; then | |
# Back up existing /etc/logrotate.conf | |
cp /etc/logrotate.conf /etc/logrotate_conf_$(date +"%Y%m%d%H%M%S").bak | |
cat >> /etc/logrotate.conf << 'JIMLogRotation' | |
/var/log/jamf-im-launcher.log { | |
missingok | |
weekly | |
copytruncate | |
create 700 jamfservice jamfservice | |
dateext | |
rotate 4 | |
compress | |
} | |
/var/log/jamf-im.log { | |
missingok | |
weekly | |
copytruncate | |
create 700 jamfservice jamfservice | |
dateext | |
rotate 4 | |
compress | |
} | |
/var/log/jamf-im-pre-enroll.log { | |
missingok | |
weekly | |
copytruncate | |
create 700 jamfservice jamfservice | |
dateext | |
rotate 4 | |
compress | |
} | |
JIMLogRotation | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment