[Logwatch] time range settings
lists-logwatch at cappella.us
Thu Feb 1 17:43:19 MST 2007
> -----Original Message-----
> From: Jason
> Subject: Re: [Logwatch] time range settings
> Than you very much for the reply. I checked out that help
> message, as well as the DateManip documentation, but I
> couldn't find exactly what I was looking for. Perhaps you'll know.
> I know 'today 11:00 for that hour' will get that hour's worth
> of logs, but is there a relative way of specifying that? I
> tried '-1 hours', but if the command runs at 10:15 it'll only
> pick up 9:15 to 10:15, not 9:00 to 10:00. '-1 hours for that
> hour' appears to do the same thing.
> Is there some way of phrasing that time range so that if I run it at
> 00:15 it'll pick up the logs from the previous day 23:00 to
> 24:00? If not it's not the end of the world I'll just do
> some scripting to handle that, but it seems like there should
> be a DateManip phrase to describe what I want, I'm just not sure what.
If I recall correctly, I think you wanted to get a report for the previous
hour, on the hour.
logwatch --print --range `date +%H:00 -d '1 hour ago'`
logwatch --print --range $(date +%H:00 -d '1 hour ago')
if you use bash.
More information about the Logwatch