Manjaro Difference between revisions of "Limit the size of .log files & the journal"

Difference between revisions of "Limit the size of .log files & the journal"

From Manjaro
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 it for 7 days before it is deleted (meaning there would be 7 separate log files for the week); compress the file 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:
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:




Cookies help us deliver our services. By using our services, you agree to our use of cookies.