I would like to know how much data I’ve used downloading updates in the past month. I update exclusively through the terminal if that matters.

  • @[email protected]
    link
    fedilink
    English
    11 year ago

    You could easily write a bash script, which logs the updates in the format you want to (date, clock, packages, total size etc). Use awk to parse the size. Probably the hardest part is if you want necessarily to have those update sizes calculated with the script instead of doing that manually each time.

    • BOMBSOP
      link
      English
      11 year ago

      I’m interested in doing this, but not tech savvy enough. My best hacking skills were to make an alias in the .bashrc that let’s me update and autoremove with one command and uses lolcat for the beauty of it lol.

      Could you point me to some training materials/instructions that would help me accomplish that?

  • @_HR_
    link
    English
    11 year ago

    If it’s not limited to packages, but all network usage, there’s vnstat.

    If you want specifically only updates, you could parse /var/log/apt/history.log with a script and query apt about the download size for each package and sum it up.

    • BOMBSOP
      link
      English
      11 year ago

      Could you point me in the direction of educational materials that would help me do that? I’m not well-educated on bash, but am willing to learn :)

      • @_HR_
        link
        English
        21 year ago

        Bash doesn’t really sound like the right tool for the job. What you might want to do, is to learn Python. You would write a parser for the history.log, and use the package name and version data from it to query apt with the Python interface: https://apt-team.pages.debian.net/python-apt/library/index.html for the size of packages in the wanted time range.

        I’m not really up to speed with what is the best place to learn Python nowdays, but you should be able check with Python communities for links to best learning places.

        And when in doubt, there’s always the Python library docs: https://docs.python.org/3/