mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-02-12 09:19:04 +00:00
1 line
9.3 KiB
JSON
1 line
9.3 KiB
JSON
{"pageProps":{"metadata":{"date":"\"2021-05-20 23:07:39 +08:00\"","date_modified":"\"2021-09-01 22:39:16 +08:00\"","language":"en","source":""},"title":"Command line: journalctl","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"options"},"children":[{"type":"text","value":"Options"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/cli.journalctl#options"},"children":[{"type":"text","value":"Options"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"examples"},"children":[{"type":"text","value":"Examples"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/cli.journalctl#examples"},"children":[{"type":"text","value":"Examples"}]},{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-2"},"children":[{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h2","properties":{"id":"watch-the-logs-from-a-specific-unit-at-boot-time"},"children":[{"type":"text","value":"Watch the logs from a specific unit at boot time"}]}]},"properties":{"className":"toc-item toc-item-h2"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h2","href":"/cli.journalctl#watch-the-logs-from-a-specific-unit-at-boot-time"},"children":[{"type":"text","value":"Watch the logs from a specific unit at boot time"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h2","properties":{"id":"delete-the-logs-older-than-a-month"},"children":[{"type":"text","value":"Delete the logs older than a month"}]}]},"properties":{"className":"toc-item toc-item-h2"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h2","href":"/cli.journalctl#delete-the-logs-older-than-a-month"},"children":[{"type":"text","value":"Delete the logs older than a month"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h2","properties":{"id":"view-the-latest-logs-with-helpful-messages"},"children":[{"type":"text","value":"View the latest logs with helpful messages"}]}]},"properties":{"className":"toc-item toc-item-h2"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h2","href":"/cli.journalctl#view-the-latest-logs-with-helpful-messages"},"children":[{"type":"text","value":"View the latest logs with helpful messages"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h2","properties":{"id":"get-the-logs-of-a-service-unit-from-2-boots-ago"},"children":[{"type":"text","value":"Get the logs of a service unit from 2 boots ago"}]}]},"properties":{"className":"toc-item toc-item-h2"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h2","href":"/cli.journalctl#get-the-logs-of-a-service-unit-from-2-boots-ago"},"children":[{"type":"text","value":"Get the logs of a service unit from 2 boots ago"}]}]}]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The logging daemon of systemd (see "},{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.journal"},"children":[{"type":"text","value":"systemd-journald"}]},{"type":"text","value":").\nNot only it can view your logs, you can ask to view specific logs and delete some of them.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For more information, see "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"journalctl.1"}]},{"type":"text","value":" manual page.\n"}]},{"type":"element","tagName":"h1","properties":{"id":"options"},"children":[{"type":"text","value":"Options"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"-b, --boot [ID][+OFFSET]"}]},{"type":"text","value":" shows the logs starting from given boot time (or current boot if empty).\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"-e, --pager-end"}]},{"type":"text","value":" to go to the end of the logs.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"-f, --follow"}]},{"type":"text","value":" watches the logs.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"-k, --dmesg"}]},{"type":"text","value":" prints the logs from the kernel.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"--list-boots"}]},{"type":"text","value":" prints a list of boots useful for knowing the boot logs from "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"-b"}]},{"type":"text","value":".\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"--user-unit"}]},{"type":"text","value":" shows logs from a user unit.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"-u, --unit [UNIT]"}]},{"type":"text","value":" shows the logs of a system unit.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"--vacuum-time [TIMESPAN]"}]},{"type":"text","value":" deletes logs older than the specified timespan "},{"type":"text","value":".\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"-x, --catalog"}]},{"type":"text","value":" prints helpful messages such as the documentation URIs.\n"}]}]}]},{"type":"element","tagName":"h1","properties":{"id":"examples"},"children":[{"type":"text","value":"Examples"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This tool is already comprehensive.\nNeeds a comprehensive database of examples to fight against this scope.\n"}]},{"type":"element","tagName":"h2","properties":{"id":"watch-the-logs-from-a-specific-unit-at-boot-time"},"children":[{"type":"text","value":"Watch the logs from a specific unit at boot time"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"journalctl --user-unit borgbackup.service -fb\n"}]}]},{"type":"element","tagName":"h2","properties":{"id":"delete-the-logs-older-than-a-month"},"children":[{"type":"text","value":"Delete the logs older than a month"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"journalctl --vacuum-time=1m\n"}]}]},{"type":"element","tagName":"h2","properties":{"id":"view-the-latest-logs-with-helpful-messages"},"children":[{"type":"text","value":"View the latest logs with helpful messages"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"journalctl -xe\n"}]}]},{"type":"element","tagName":"h2","properties":{"id":"get-the-logs-of-a-service-unit-from-2-boots-ago"},"children":[{"type":"text","value":"Get the logs of a service unit from 2 boots ago"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"journalctl --boot -2 --user-unit borgbackup@personal-drive.service\n"}]}]}]},"backlinks":[{"path":"/linux.systemd.journal","title":"systemd-journald"}]},"__N_SSG":true} |