how to use --last-period ?

Hi,

Does anyone know how to actually use “–last-period” when trying to gather stats on CloudMin Virtual Machines via the commandline?

The documentation (list-systems – Virtualmin) is a bit vague on this:

But, none of this works:
–last-period July
–last-period July2011
–last-period 201107
–last-period 1month

Howdy,

The --last-period option doesn’t take a parameter… it means specifically, the “last” or “previous” period. To use that, you could use something like this syntax:

cloudmin list-systems --multiline --last-period

To specify what period to use, and not just use the last period, you could look into the “–period-ago” parameter.

-Eric

Hi Eric,

Ok, let’s say I want stats for July, what command & syntax should I then use?

The time periods are all relative to now… you could use something like this:

cloudmin list-systems --multiline --period-ago “1 month”

thanx.

Now for the technical question:

Is this literally one month ago, i.e. from 3rd June to 3rd July,
or is it actually last month, i.e. 1July - 31st July?

Ok, I see now.

It’s basically from the 1st day of last month to the 1st day of this month:

[/quote]
Start of period: 01/Jul/2011 00:00 (2915850 seconds ago)
End of period: 01/Aug/2011 00:00 (237450 seconds ago)
[/quote]

So I presume it’s safe to say that it captures the whole of last month’s usage?

Well, it appears to be showing the period that was active 1 month ago from today.

In the output, you should see something like this:

Start of period: 01/Jul/2011 00:00 (2914606 seconds ago) End of period: 01/Aug/2011 00:00 (236206 seconds ago)

Although today is Aug 3, it’s not showing a period beginning on July 3, it’s showing the period beginning on July 1.

-Eric

So I presume it’s safe to say that it captures the whole of last month’s usage?

Yeah, I’d assume you’re seeing data from what it lists as the “Start of period” through the “End of period”.

-Eric