![]() ![]() ![]() ![]() You need to perform 3 tasks periodically : * * * * * root & wget some_url/usage.db -O /tmp/usage.db Note : if you put it in RAM and have access to some online storage, you can schedule a periodic backup task and restore it if missing, for example : 15 * * * * root cd /tmp & ftpput -u username -p password usage.db. Then hope your router will not need to be rebooted, else all the counters will start over from zero. If you don't, then put it in RAM, in /tmp. It will be written to very often, so it is not recommended to put it on flash memory (ie jffs). The database is a file that will contain the accounting records. One way to circumvent this is to schedule a cron job that will redownload it if missing : * * * * * root & wget -O /tmp/wrtbwmon & chmod +x /tmp/wrtbwmon If you don't have jffs, put the script in /tmp instead : wget -O /tmp/wrtbwmon & chmod +x /tmp/wrtbwmon Then make it executable : chmod +x /jffs/wrtbwmon You can execute the following command directly (telnet, ssh, or from the web interface in Administration/Commands) : wget -O /jffs/wrtbwmon This way it will not get lost after a reboot. If you have jffs (on any other permanent storage - cifs, mmc.) enabled, I recommend you put the script on that partition. the following commands built in : echo touch mv rm sed cat chmod grep cut date iptables.DD-WRT (including routers with only 2mb flash with micro-plus).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |