journalctl day before yesterday
Hi *, how do I specify the day before yesterday for journalctl output? journalctl --all --since=yesterday --until=today gives all entries from midnight to midnight yesterday. journalctl --all --since=-3d --until=-2d seems to output all entries between 72 hours and 48 hours back from actual time. And I don't want to enter an exact date, because I'd like to create aliases for this. TIA. Bye. Michael.
On Freitag, 23. August 2024 15:23:40 MESZ Bengt Gördén wrote:
On 2024-08-23 15:20, Bengt Gördén wrote:
--since "1 day ago"
You probably got it but for clarity
--since "2 day ago"
Thx, but no - this gives the same result as -2d Started at Aug 23 16:16:05, the first output line has Aug 21 16:21:56.
On 2024-08-23 16:16, mh@mike.franken.de wrote:
On Freitag, 23. August 2024 15:23:40 MESZ Bengt Gördén wrote:
On 2024-08-23 15:20, Bengt Gördén wrote:
--since "1 day ago"
You probably got it but for clarity
--since "2 day ago"
Thx, but no - this gives the same result as -2d Started at Aug 23 16:16:05, the first output line has Aug 21 16:21:56.
Okay. If I understand you correctly, you want from 00:00? journalctl --since=`date --date='2 days ago' +%Y-%m-%d` -- /bengan
On Freitag, 23. August 2024 16:16:54 MESZ mh@mike.franken.de wrote:
On Freitag, 23. August 2024 15:23:40 MESZ Bengt Gördén wrote:
On 2024-08-23 15:20, Bengt Gördén wrote:
--since "1 day ago"
You probably got it but for clarity
--since "2 day ago"
Thx, but no - this gives the same result as -2d Started at Aug 23 16:16:05, the first output line has Aug 21 16:21:56.
Something like this would work, but seems unnecessarily complicated: journalctl --all --since="$(date --date='2 days ago' '+%Y-%m-%d 00:00:00')" --until="$(date --date='2 days ago' '+%Y-%m-%d 23:59:59')
On Freitag, 23. August 2024 16:58:34 MESZ Bengt Gördén wrote:
On 2024-08-23 16:28, mh@mike.franken.de wrote:
Something like this would work, but seems unnecessarily complicated: But that's why you want/need the alias, right? If it had been straightforward, no alias is needed.
good point :) alias jct3="/usr/bin/journalctl --all --since=\"$( /usr/bin/date --date='2 days ago' '+%Y-%m-%d 00:00:00' )\" --until=\"$( /usr/bin/date --date='2 days ago' '+%Y-%m-%d 23:59:59' )\""
participants (2)
-
Bengt Gördén
-
mh@mike.franken.de