Stephane, I originally added -mindepth 1 to avoid deleting /var/crash/ itself in the cronjob. However, I think -type f -mindepth 1 -maxdepth 1 is a safer way.
So for the security update I propose to change
find /var/crash -mindepth 1 -mtime +7 -print0 | xargs -0 rm -f find /var/crash -mindepth 1 -empty -print0 | xargs -0 rm -f
to
find /var/crash -mindepth 1 -maxdepth 1 -type f -mtime +7 -print0 | xargs -0 rm -f find /var/crash -mindepth 1 -maxdepth 1 -type f -empty -print0 | xargs -0 rm -f
for the sake of minimal and well-understood changes. I'll do the more standards friendly version you proposed upstream.
(Disclaimer: completely untested yet, I just confirmed that -type f does not catch symlinks)
Stephane, I originally added -mindepth 1 to avoid deleting /var/crash/ itself in the cronjob. However, I think -type f -mindepth 1 -maxdepth 1 is a safer way.
So for the security update I propose to change
find /var/crash -mindepth 1 -mtime +7 -print0 | xargs -0 rm -f
find /var/crash -mindepth 1 -empty -print0 | xargs -0 rm -f
to
find /var/crash -mindepth 1 -maxdepth 1 -type f -mtime +7 -print0 | xargs -0 rm -f
find /var/crash -mindepth 1 -maxdepth 1 -type f -empty -print0 | xargs -0 rm -f
for the sake of minimal and well-understood changes. I'll do the more standards friendly version you proposed upstream.
(Disclaimer: completely untested yet, I just confirmed that -type f does not catch symlinks)