I use a 3G cellular Internet connection with a very strict traffic limit, but some times I go to office and use an unlimited and fast cable connection (and of course I do traffic-consuming operations, like updating the system there).
I'd like to keep track of how much have I already downloaded using the mobile connection (so, it can either filter by interface or be easily suspendable so that I can pause it when I use an unlimited line) this month (so, the counter most not reset when I reboot my laptop or reconnect, I'd lile to only reset it manually).
What's the easiest way to do this in Ubuntu 10.10?
I wouldn't like to set up any complex monitoring/billing systems.
The simplest method
You can use
ifconfig
on you network interface (mine is eth0) - it counts the amount of data sent and received since the interface was started.Making it persistent
Not so simple
The Ubuntu community wiki lists instructions on using a couple of tools - ipac-ng and vnstat. They aren't necessarily simple, but they are better than writing your own scripts:
https://help.ubuntu.com/community/HowToMonitorInternetTrafficTotals
If you want a graphical way to track your network usage:
try:
sudo apt-get install screenlets
in a terminal, then launch screenlets from (alt+f2) the run dialog, and click the install screenlet button when the config dialog comes up.For each of these, you can choose which interface (eth0, wlan0, etc) to track from their preferences. You can also clear your totals every time you disconnect, so you know exactly how much you have used.