1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

saving bandwidth stats to nvram?

Discussion in 'Tomato Firmware' started by Devotedfollower, Oct 1, 2010.

  1. Devotedfollower

    Devotedfollower LI Guru Member

    What's everyone's suggestions on doing this? SHould one do it or will it kill the nvram?

  2. Toastman

    Toastman Super Moderator Staff Member Member

    Obviously it depends on how often you save the information. For me, saving every 12 hours seems to be acceptable, the router's useful lifespan will be over long before the NVRAM gives up the ghost.
  3. petm

    petm Networkin' Nut Member

    if i'm saving to one destination now, like nvram, and want to change that to say cifs, how can i do that without losing the already existing data?

    another nvram question: under DDNS, what does
    "Save state when IP changes (nvram commit)"
    do? i mean, why is it there? to prevent updating twice with the same ip? i'd hope the router does that by comparing the currently registered address with the one it's going to register ...

    oh and while we're talking about storing locations and such ;-): is it possible to access the jffs partition from a windows network?
  4. premudriy

    premudriy LI Guru Member

    1) Backup your logs by going to "Administration->Bandwidth Monitoring -> Backup button" and make 2 copies of backup file just to be sure. Always a good idea to backup.
    2) Enable CIFS and make sure that it says it's mounted successfully (CIFS1 or CIFS2)
    3) Go the "Administration->Bandwidth Monitoring" again and set "Save History Location" to the CIFS that you enabled/mounted.
    4) Make sure you check the "Save on shutdown" checkmark and "Create Backups" checkmark
    5) Click "Save" button of course.
    5) Reboot the router to make sure it works (i.e. bandwidth stats restored)

    You shouldn't loose any data, but if you do, you can always restore the file backup file from the step #1.
  5. petm

    petm Networkin' Nut Member

    alright, thanks. clicking "create backups" wasnt possible, it was disabled. following your instructions the last 24h data was still there, the daily statistics werent. then i restored the backup (thanks for that hint!) and now everything is fine.
  6. premudriy

    premudriy LI Guru Member

    I went to my router and "create backups" is also disabled. Hmm, I just used it like a few weeks ago, just after I upgraded to 1.28 RAF and I remember that it worked (I think). Wait a few minutes, I'll try to investigate and post back.
  7. petm

    petm Networkin' Nut Member

    maybe it depends on the saving location? i have set it to nvram now, maybe it wants to reduce writes. what does that checkbox even do? save the stuff twice?

    but in case i wasnt clear: your instructions worked in the end, so you dont have to go through too much trouble to figure the rest out.
  8. premudriy

    premudriy LI Guru Member

    Ok, that option (create backups) becomes available after the following:
    1) Mount CIFS location successfully, i.e it should show the total/free size in CIFS menu. I did it with CIFS1.
    2) Go to Bandwidth Monitoring and from drop down box choose the saving location (CIFS1 in my case)
    3) Now "create backups" becomes clickable/available.

    Create backups option makes a copy of the backup file, i.e in addition to the main "tomato_rstats_xxxxxxx.gz" file you will have "tomato_rstats_xxxxxxx_y.bak" file, where "y" for the extra-backup file will increment (1, 2, 3, 4). So, you will have extra backup created every time when you shutdown or when scheduled time will come. Therefore, you will end up with many many extra-backup files over time, so you might want to delete some of them periodically (but they are tiny files).

    This is useful because the backup file may get corrupted and it's nice to have some extra files. I've had that happen before and I'm glad that it had extra-backup files for many days back. Basically my stats were reset somehow, and then a few times in a row it wrote new/reset file into backup location. I only noticed that my stats were reset/messed-up a few days later and I just restored some extra-backup file from a few days back that was not reset.

    Also, I am now using a script which backs up my bandwidth stats to an FTP account, which I got from Comcast ISP for free (everyone does), so it's all automatic and I don't have to have another computer running for CIFS. I also think that Comcast's FTP is more reliable than would be my computer running (power outages, Acts of God, who knows). If you want I can give you the script. I have a version that I fixed to work with the latest Tomato 1.28 RAF (which doesn't have ftpget, but has wget binary).
  9. crutchman

    crutchman Networkin' Nut Member

    Reading these, I would like to have the script since I too have Comcast.

Share This Page