Bug#985452: cowbuilder: add cron job to remove stray cow.[0-9]* dirs from /var/cache/pbuilder/build

2021-03-22 Thread Mattia Rizzolo
Control: tag -1 -patch
Control: retitle -1 cowbuilder: leaves around stray 
/var/cache/pbuilder/build/cow.[0-9]+

On Thu, Mar 18, 2021 at 02:19:46PM +0100, Hans-Christoph Steiner wrote:
> I've been using cowbuilder a long time.  I recently noticed that I had
> ~20gigs of stuff in /var/cache/pbuilder/build:

mh, that's indeed not nice.

> There were no active sessions, so it seems these are just forgotten
> detritus.  I propose adding a cron job to clean those up.  I attached
> one that works for me.

Sorry, but a cronjob for this kind of things is not the proper solution.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
More about me:  https://mapreri.org : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Bug#985452: cowbuilder: add cron job to remove stray cow.[0-9]* dirs from /var/cache/pbuilder/build

2021-03-18 Thread Hans-Christoph Steiner
Package: cowbuilder
Version: 0.88
Severity: normal
Tags: patch

Tags: patch

Dear Maintainer,

I've been using cowbuilder a long time.  I recently noticed that I had
~20gigs of stuff in /var/cache/pbuilder/build:

 .../pbuilder/build $ ls -ld cow.[02-9]*
drwxr-xr-x 23 root root 4096 Dez 29 17:06 cow.21198
drwxr-xr-x 22 root root 4096 Nov 23 22:48 cow.21823
drwxr-xr-x 18 root root 4096 Jän  9  2020 cow.22112
drwxr-xr-x 22 root root 4096 Dez 13 00:31 cow.22971
drwxr-xr-x 22 root root 4096 Dez 12 22:51 cow.23828
drwxr-xr-x 22 root root 4096 Okt  8 18:01 cow.27699
drwxr-xr-x 22 root root 4096 Jän  3 15:05 cow.28802
drwxr-xr-x 22 root root 4096 Mai 14  2020 cow.30699
drwxr-xr-x 18 root root 4096 Aug 19  2020 cow.30973
drwxr-xr-x 22 root root 4096 Nov 24 14:38 cow.4974
drwxr-xr-x 22 root root 4096 Mai 26  2020 cow.6459
drwxr-xr-x 22 root root 4096 Jän  3 16:28 cow.7114
drwxr-xr-x 23 root root 4096 Dez 13 00:08 cow.7734
drwxr-xr-x 22 root root 4096 Feb 15 13:21 cow.8510

There were no active sessions, so it seems these are just forgotten
detritus.  I propose adding a cron job to clean those up.  I attached
one that works for me.


-- System Information:
Debian Release: 10.8
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (100, 
'proposed-updates')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-14-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cowbuilder depends on:
ii  cowdancer0.88
ii  libc62.28-10
ii  libncurses6  6.1+20181013-2+deb10u2
ii  libtinfo66.1+20181013-2+deb10u2
ii  pbuilder 0.230.4

cowbuilder recommends no packages.

cowbuilder suggests no packages.

-- no debconf information
#!/bin/sh -e

for f in /var/cache/pbuilder/build/cow.[0-9]*; do
test -d "$f" || continue
kill -0 `echo $(basename $f) | sed s',cow\.,,'` 2> /dev/null && continue
rm -rf --one-file-system "$f"
done