On 12/31/13 20:25, Frank Murphy wrote:
On Tue, 31 Dec 2013 20:17:42 +0800
Ed Greshko <Ed.Greshko(a)greshko.com> wrote:
> On 12/31/13 19:24, Frank Murphy wrote:
>> Has anyone found a way to:
>> journalctl | grep "last 10 minutes"
>>
>>
> man journalctl
>
> --since=, --until=
> Start showing entries on or newer than the specified date,
> or on or older than the specified date, respectively. Date
> specifications should be of the format "2012-10-30 18:17:16". If the
> time part is omitted, 00:00:00 is assumed. If only the seconds
> component is omitted, :00 is assumed. If the date component is
> omitted, the current day is assumed. Alternatively the strings
> yesterday, today, tomorrow are understood, which refer to 00:00:00 of
> the day before the current day, the current day, or the day after the
> current day, respectively. now refers to the current time. Finally,
> relative times may be specified, prefixed with - or +, referring to
> times before or after the current time, respectively.
>
>
> ???
Been there already culdn'f find a last 10mins
How does that give me 10 mins, and every 10 mins,
without enternining specific time
crontab -e
*/10 * * * * *
"journalclt -b -10 | mailx "Journalctl for last 10 mins" user"
Confused, hence the Q?
Not thinking straight since it is 3 hrs to New Year's..... But, a "hack"
would be.....
1,11,21,31,41,51 * * * * /usr/bin/date +%Y-%m-%d\ %H:%M:%S > /tmp/mydate
0,10,20,30,50,50 * * * * journalctl --since="`cat /tmp/mydate`" | mailx
"Journalctl for last 10 mins" user"
There probably is a better way to get a timestamp from 10 minutes ago..... And I
can't now wrap my head around the "relative times" part of the man page.
Too much vodka.
--
Getting tired of non-Fedora discussions and self-serving posts