Manipulating journalctl output
Suvayu Ali
fatkasuvayu+linux at gmail.com
Wed Jan 1 23:08:58 UTC 2014
On Wed, Jan 01, 2014 at 11:52:04PM +0100, Mateusz Marzantowicz wrote:
> On 01.01.2014 20:57, Suvayu Ali wrote:
>
> > Now my questions:
> >
> > 1. How can I filter messages printed to the logs from my cron jobs? I
> > will try to explain by example:
> >
> > $ journalctl -ru crond --since=-3d
> > -- Logs begin at Sun 2013-11-17 02:48:46 CET, end at Wed 2014-01-01 20:31:27 CET. --
>
> # journalctl -u crond.service
>
> Do it as root, and add .service suffix to crond.
>
> Bash completion is your friend here, hitting TAB twice after -u option
> will give you units that are recognized.
>
> journalctl is user-aware and show only what's appropriate.
Actually, if I'm in the systemd-journal group it is equivalent. That
said, I get the same output as root. I use bash-completion, and the
.service is optional when used with -u (as I mentioned in my email). I
tried with and without the .service. It works both ways for sendmail,
just not crond.
Cheers,
--
Suvayu
Open source is the future. It sets us free.
More information about the users
mailing list