Comment 39 for bug 357024

Martin Pitt (pitti) wrote :

Indeed that's the same case for the stable patches I proposed. All paths delivered by find start with /var/crash/, so the -- isn't strictly needed. OTOH it does not really hurt to have it, so if you upload the debdiffs, please feel free to add them.

As for "use an existing program", /lib/init.d/bootclean.sh does

        find . -depth -xdev $TEXPR $EXCEPT ! -type d \
                -print0 | xargs -0r rm -f -- \
                || { report_err ; return 1 ; }

(with TEXPR being something like -mtime, thus not affecting result structure, and EXCEPT being something like "! -path ...", thus only some filters and also not affecting result structure).

Thus my updated find expression

  find /var/crash -mindepth 1 -maxdepth 1 \( -type f -o -type l \) -mtime +7 -print0 | xargs -0 rm -f

is much stricter than the bootclean.sh one, except for the --.

I still think it is sufficient.

Thanks!