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

imported>Handy
imported>Handy
Line 44: Line 44:


<br clear="all"/>
<br clear="all"/>
== The Journalctl command - a quick reference ==
=== Add user to adm group, gives <user> full use of the journalctl command: ===
# usermod -a -G adm handy
===== Access to full journal containing info from the system & users: =====
$ journalctl
=== Live view, shows the last 10 lines of the journal & all content as it happens: ===
$ journalctl -f
== Basic filtering: ==
=== Shows all output to the journal since the last boot:===
$ journalctl -b
=== Shows all output with priority level ERROR & worse, since last boot: ===
$ journalctl -b -p err
== Filtering based on time: ==
=== Since yesterday: ===
$ journalctl --since=yesterday
=== Give a specific time period: ===
$ journalctl --since=2012-10-15 --until="2011-10-16 23:59:59"
=== Pick a specific service & time period: ===
$ journalctl -u httpd --since=00:00 --until=9:30
== Point journalctl at specific devices, services, binaries ==
=== Look at a specific device: ===
$ journalctl /dev/sdc
=== Check on a binary: ===
$ journalctl /usr/sbin/vpnc
=== Check on the interlieved output from two specifics: ===
$ journalctl /usr/sbin/vpnc /usr/sbin/dhclient
=== Show all systemd units that have been started in your journal: ===
$ journalctl -F _SYSTEMD_UNIT
You can then interrogate the journal specifying any of those units.
== A summation ==
The Systemd Journal is capable of advanced functions beyond what has been mentioned here. The above is very good food for thought for people that are wondering if they need to be running '''syslog-ng''' or the like that creates most of the '''/var/log/*log''' files on their systems.
By experimenting with the above commands one can make an informed decision for themselves.


= Managing /var/log/* files =
= Managing /var/log/* files =
Anonymous user