Score:4

Repository Server - apt-mirror - How to report the list of downloaded packages on every run?

cn flag

apt-mirror outputs the size of downloaded packages... 167.3 MiB will be downloaded into archive.

But how to report the list of downloaded packages on every run?

Example: Following packages were downloaded: apache, chrome, ...

cn flag
@OrganicMarble would you share it?
Organic Marble avatar
us flag
Your question made me want to reexamine it, I put it in long ago. It's `find /[directory]/apt-mirror/mirror/* -mmin -60 | grep "pool" | sort` But I can't remember why I did the grep, or why I have the `*`. Something like this could probably work if someone who knows bash chimes in.
Score:1
jp flag

There's nothing built-in, but apt-mirror is a fairly basic perl script. If you are comfortable doing it then you could probably add a patch at https://github.com/apt-mirror/apt-mirror/blob/7d521b168ab34fd38fd38bbb26acad1f43e262a7/apt-mirror#L910 .

You could certainly use a Bash solution as a comment suggests if it suits your needs. The postmirror.sh script would be a very handy location to run it. A line like this will print packages updated in the past hour

find . -type f -path '*pool*' -mmin -60 -print

Unfortunately, apt-mirror is not actively developed. There are several bugs that will prevent it from properly mirroring apt repositories for recent releases. You could consider using a fork where these bugs have been patched. If you do, then you could potentially request this feature from the fork maintainers.

Score:0
us flag

A while back, I added a line to postmirror.sh (after the line with clean.sh like this)

find /[mirror]/mirror/ -mmin -60 | grep "pool" | sort | tee /home/[username]/mirror/mirror-$_now.txt

Each time apt-mirror runs, it writes the output into the apt-mirror.log and creates a file in the /mirror directory of my home directory with contents like this:

/[mirror]/mirror/dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-unstable
/[mirror]/mirror/us.archive.ubuntu.com/ubuntu/pool/main/l/linux-firmware
/[mirror]mirror/us.archive.ubuntu.com/ubuntu/pool/main/l/linux-meta-hwe-5.11
/[mirror]/mirror/us.archive.ubuntu.com/ubuntu/pool/main/l/linux-meta-oem-5.14
/[mirror]/mirror/us.archive.ubuntu.com/ubuntu/pool/main/l/linux-oem-5.14
/[mirror]/mirror/us.archive.ubuntu.com/ubuntu/pool/main/l/linux-signed-oem-5.14
/[mirror]/mirror/us.archive.ubuntu.com/ubuntu/pool/restricted/l/linux-restricted-modules-hwe-5.11
/[mirror]/mirror/us.archive.ubuntu.com/ubuntu/pool/restricted/l/linux-restricted-modules-oem-5.14
/[mirror]/mirror/us.archive.ubuntu.com/ubuntu/pool/restricted/l/linux-restricted-signatures-oem-5.14
/[mirror]/mirror/us.archive.ubuntu.com/ubuntu/pool/universe/h/htmldoc

My desire was to get it to list individual .debs but I haven't been able to make that work using this approach, perhaps because those files have timestamps much further in the past.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.