Difference between revisions of "Limit the size of .log files & the journal"
Limit the size of .log files & the journal (view source)
Revision as of 14:19, 13 August 2013
, 10 years ago→Some uses for Logrotate
imported>Handy |
imported>Handy |
||
Line 53: | Line 53: | ||
== Some uses for Logrotate == | == Some uses for Logrotate == | ||
For example, if we wanted to rotate all of the .log files in our /var/log/ directory (some .log files will not be affected by this command) on a daily basis; keep | For example, if we wanted to rotate all of the .log files in our /var/log/ directory (some .log files will not be affected by this command) on a daily basis; keep the rotated files for 7 days before they are deleted (meaning there would be 7 separate log files for the week); compress the files but do it on the next cycle; do it in a fashion where the original contents of the file is copied before the original file's contents is deleted; do nothing if the file is empty; if the file is missing don't give an error; we should be able to do that with the following: | ||