Linux daily, weekly and monthly network usage

bandwidth-controllinuxnetworking

How one could monitor and keep logs of daily, weekly and monthly bandwidth usage of Linux servers? This is important for cheap VPS solutions where they have monthly caps in bandwidth.

Preferable some lightweight command-line tool just for this purpose.

Even more preferably nothing which includes PHP or web code.

It's enough to count all inbound / outbound traffic per network interface. This is just for one VPS, nothing heavy weight needed.

Best Answer

Utilize a network/resource monitoring solution like Observium or Munin or Cacti... That will provide graphical historical and summary information about your traffic patterns. Run it directly on the server.

For a command line option, collectl is nice.