Page 1 of 1
Persistent Quota Stats
Posted: Tue Dec 20, 2016 8:21 pm
by cwswpl
I'm just setting up my new WR1043ND with Gargoyle 1.8.1.
The key reason I want gargoyle is to be able to apply a monthly quota to internet usage as my contract with the ISP involves punitive excess charges.
I've worked out how to setup the quota, and it looks like it's collecting usage history OK, but I notice that when the router is powered off and on again, the history is lost.
This won't do of course, for quotas measured over a month, there could easily be a power cut or fuse tripped in that time.
What's the method for ensuring that usage history remains persistent?
Re: Persistent Quota Stats
Posted: Tue Dec 20, 2016 9:02 pm
by Lantis
Usage history is backed up every 4 hours.
On a reboot (issued through the system menu), the data is saved before rebooting.
A hard power cut will of course lose up to 4 hours of data.
Increasing the frequency of this is not recommended for preserving flash read/write lifespan.
Re: Persistent Quota Stats
Posted: Tue Dec 20, 2016 9:13 pm
by cwswpl
Thanks Lantis. 4 hourly backups sounds fine, but then something is wrong in my case.
It was a hard poweroff (when I was installing physically I knocked the plug out of the wall).
But I lost more than 4 hours, the usage data I had collected from last night (14 hours before the power off) is all gone, it's as if it's just started recording from the latest uptime.
How should I diagnose? Maybe the backup process is disabled? Is there a UI for this?
Re: Persistent Quota Stats
Posted: Tue Dec 20, 2016 10:16 pm
by Lantis
If you're familiar with command line, you can check that the task is scheduled to operate in the crontab
viewtopic.php?f=8&t=8505
Note, thats a lowercase L
should result in at least the following line
Code: Select all
0 0,4,8,12,16,20 * * * /usr/bin/backup_quotas >/dev/null 2>&1
Re: Persistent Quota Stats
Posted: Wed Dec 21, 2016 12:41 am
by cwswpl
Yes I get the following:
0,1,11,21,31,41,51 * * * * /usr/bin/set_kernel_timezone >/dev/null 2>&1
0 0,4,8,12,16,20 * * * /usr/bin/backup_quotas >/dev/null 2>&1
0 0,4,8,12,16,20 * * * /tmp/bw_backup/do_bw_backup.sh
So looks like the job is scheduled, but maybe not being executed. Do cron jobs get written to a log?
I tried the logread command - nothing obvious there, but then I only got entries for the last 1.5 hours - shouldn't it show everything since uptime started? Does the log get backed up to flash also? I noticed the do_bw_backup job is also scheduled 4 hourly.
Re: Persistent Quota Stats
Posted: Wed Dec 21, 2016 1:22 am
by Lantis
Give it another day or so to monitor the behaviour.
I don't recall if they get logged.
But the logread is a ring buffer with a maximum size (can't recall how big).
But it just rotates the oldest data out.
Re: Persistent Quota Stats
Posted: Wed Dec 21, 2016 4:45 am
by tapper
Hi there mate. Try and upgrade to 1.9.x from here:
viewtopic.php?f=14&t=9415
1.8.1 had a few strange bugs.
WARNING: DO NOT PRESERVE SETTINGS