Posted: Sun Sep 07, 2014 19:21 Post subject: Save the traffic log data to NVRAM more often?
How might I cause the router to save the traffic log data (daily internet consumption) more often. I understand it is saved only once a day and may be lost if router is rebooted. Is there a command I can use to force a write to NVRAM that I can issue manually or place in a cron job?
I do not believe that would at all be a good idea and would be difficult to implement. It would make more sense to send it outside the router to a USB or CIFS drive for storage. NVRAM is only 64k and if you fill it up with stuff that isn't needed to run the router. _________________ EA-6900
Asus 68U
I do not believe that would at all be a good idea and would be difficult to implement. It would make more sense to send it outside the router to a USB or CIFS drive for storage. NVRAM is only 64k and if you fill it up with stuff that isn't needed to run the router.
I am just talking about the daily statistic of how much is uploaded/downloaded which does not take a lot of space. But I would be interested in how to store it on a thumbdrive as well as how to save it more often.
Barry,
are you saying that that command alone will save it? Shouldn't you have to redirect it as the traffic daemon saves it in RAM. You would have to move it to NVRAM wouldn't you? _________________ EA-6900
Asus 68U
Joined: 26 Jan 2008 Posts: 13049 Location: Behind The Reset Button
Posted: Mon Sep 08, 2014 14:58 Post subject:
try it.
nvram commit from telnet or the admin commmands tab, reboot the router. your ttraff data will be there.
you can also backup & restore the ttraff data from the wan status screen.
nvram is shadowed into ram when the router boots. notice in regard to changing parameters there is save and apply?
changes to nvram happen in ram. the commit (or apply) saves the nvram section that is in ram to the nvram area of the flash chip.
depending on what you change, the apply may reboot the router so services can stop / start with the new nvram variable. _________________ [Moderator Deleted]
but couldn't we also set it to same elsewhere such as a USB attached storage. There must be a way to redirect it. Just thinking out loud now. will have to look into that today. _________________ EA-6900
Asus 68U
Joined: 26 Jan 2008 Posts: 13049 Location: Behind The Reset Button
Posted: Mon Sep 08, 2014 15:24 Post subject:
cdmarshall wrote:
but couldn't we also set it to same elsewhere such as a USB attached storage. There must be a way to redirect it. Just thinking out loud now. will have to look into that today.
that has been a feature requested in trac for a few years by myself and others but has not been addressed and probably will not be. _________________ [Moderator Deleted]
http://www.dd-wrt.com/wiki/index.php/Useful_Scripts
#!/bin/sh
T=0
D=`nvram show|grep traff-|cut -f1 -d=|awk -F"-" '{print $3,$2}'|cut -b-4,6-`
for d in $D
do
if [ $T -lt $d ]
then
T=$d
fi
done
T=`expr $T - 100`
for d in $D
do
if [ $T -gt $d ]
then
N=traff-`echo ${d}|cut -b5-`-`echo ${d}|cut -b-4`
nvram unset $N
fi
and then of course to clear the traffic data so it doesn't fill you NVRAM up
for i in `nvram show | grep traff- | cut -f1 -d=""`; do nvram unset $i; done
at least its a stating point to figure out options for moving it. If we can get it to a file to email it we should be able to get it to a file to store it elsewhere. _________________ EA-6900
Asus 68U
Does this write only the blocks of NVRAM that have changes, or does it write them all?
If I put this in a cron tab to run 3-4 times a day is that going to put significant wear on the flash over a year or two, as compared to the normal once a day writes of the traffic plus normal occasional changes of settings?
I just want to save it back to the NVRAM more often. Will it cause significant wear on the flash over a few years if I write it out 3-4 times a day on a cron tab? If someone has a way to move it to USB that would be OK too.
Anyone have any working solutions to save the traffic data on a USB device, either with the built-in traffic daemon, or some other optware? I would like to get something working on USB that saves more than once a day.