I want to stop my Raspberry Pi to create System-wide Logs in Order to save Memory Space. Is there a Way to disable Logrotate?

I Hope You can help me

up vote 1 down vote accepted

logrotate periodically runs and typically rotates logs, which means it performs an operation on a log file every so often. Typically it copies the existing log file to a backup and starts the log file over, and will only keep so many backups.

If you don't have logrotate run every so often, your logs will just grow and grow, and that's not what you want.

You can tell it to keep no backups by specifying rotate 0 (or a lower number) for the specific log. Look in /etc/logrotate.d to find the specific configuration fragment. It's been awhile since I've looked into logrotate but I think you can specify it to limit the size of files and such.

Reference.

Supposedly you could uninstall packages providing linux-kernel-log-daemon and system-log-daemon to make information logged by daemons via syslog go to nowhere.

If it's not possible (I don't know as I need syslog on all my machines), you could possibly configure an instance which provides the mentioned virtual packages on your machine to log to nowhere—all modern implementations of syslog can do this.

Note that this won't prevent all logging on your machine as certain programs log directly to files and not to syslog, at least by default; the Apache web server is a good example. To deal with such programs, you'll have to identify them and disable their logging using their own means for configuration.

  • A much simpler but equivalent solution is to configure syslog (or what have you, these days) to not store logs on disk. You will probably want to set up console logging instead for everyting in order to be able to troubleshoot. But once something is too old for the scroll buffer, it's gone forever. – tripleee Oct 21 '14 at 5:36

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.