How can I make vnstat start/stop on the 24th of the month?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
AZgl1800
Level 20
Level 20
Posts: 11146
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

How can I make vnstat start/stop on the 24th of the month?

Post by AZgl1800 »

the title says it all

I am on a Satellite connection, and I started my account with them on the 24th last month.
Weird these guys are, they bill you on the day you start, instead of prorating to the 1st of the month and then have all subsequent bills follow the calendar.

So, it would sure be handy if vnstat could be programmed to start/stop on the 24th of the month.

Data Used.png
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
ajgringo619

Re: How can I make vnstat start/stop on the 24th of the month?

Post by ajgringo619 »

I use these commands to display my daily usage:

Code: Select all

vnstat | grep "today" | awk '{print $5 $6}'    # upload
vnstat | grep "today" | awk '{print $2 $3}'    # download
You could write a script to start on the 24th and just add the daily totals.
User avatar
AZgl1800
Level 20
Level 20
Posts: 11146
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: How can I make vnstat start/stop on the 24th of the month?

Post by AZgl1800 »

ajgringo619 wrote: Sun Dec 02, 2018 4:13 pm I use these commands to display my daily usage:

Code: Select all

vnstat | grep "today" | awk '{print $5 $6}'    # upload
vnstat | grep "today" | awk '{print $2 $3}'    # download
You could write a script to start on the 24th and just add the daily totals.
Easy for you to say, but I know ZERO about writing scripts.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
ajgringo619

Re: How can I make vnstat start/stop on the 24th of the month?

Post by ajgringo619 »

:lol: Let me get back to you. I won't have time until later on this evening (PDT).
ajgringo619

Re: How can I make vnstat start/stop on the 24th of the month?

Post by ajgringo619 »

Found this link, which goes into great detail on vnstat: https://www.booleanworld.com/monitor-ne ... ng-vnstat/
User avatar
AZgl1800
Level 20
Level 20
Posts: 11146
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: How can I make vnstat start/stop on the 24th of the month?

Post by AZgl1800 »

ajgringo619 wrote: Sun Dec 02, 2018 6:20 pm :lol: Let me get back to you. I won't have time until later on this evening (PDT).
No hurry, we got until next Thanksgiving to make it work :mrgreen:
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
ajgringo619

Re: How can I make vnstat start/stop on the 24th of the month?

Post by ajgringo619 »

Figures if I put in a little effort...

This is actually very simple - no scripting involved. Edit /etc/vnstat.conf and change this line:

Code: Select all

# on which day should months change; default is 1
MonthRotate 24
Then when you run vnstat -d, you'll get what you want.
User avatar
AZgl1800
Level 20
Level 20
Posts: 11146
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: How can I make vnstat start/stop on the 24th of the month?

Post by AZgl1800 »

thank you,
missed this post earlier.....
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
Locked

Return to “Software & Applications”