Skip to content

Instantly share code, notes, and snippets.

@johngrimes
Created January 8, 2014 00:25
Show Gist options
  • Save johngrimes/8309452 to your computer and use it in GitHub Desktop.
Save johngrimes/8309452 to your computer and use it in GitHub Desktop.
Keep development and test log files to a manageable size on your Mac
# Put this into /etc/newsyslog.conf, or into a .conf file under /etc/newsyslog.d/
# Format: [logfile_name] [owner:group] [mode] [count] [size] [when] [flags] [path_to_pid_file] [signal_number]
# See https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man5/newsyslog.conf.5.html#//apple_ref/doc/man/5/newsyslog.conf
# This trims any log file in this directory that has exceeded 10 MiB in size.
# The G flag allows you to use globbing in the logfile_name field.
/path/to/your/log/files/*.log user:group 640 0 10486 * G
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment