Hallo, 

a recent post on misc@ mentioned the following crontab(5) command to
remove core files:

@reboot /usr/bin/find ~ -fstype local -name '*.core' -delete
( https://marc.info/?l=openbsd-misc&m=169303728425504 )

I wondered why I did not use the "-delete" primary but the "-print0 |
xargs -0" pipeline, back when I added the cron entry. 
Thus I change the crontab entry to use "-delete".

I have another primary in my parameters to find: "-maxdepth 1".

My complete crontab(5) entry reads:

/usr/bin/find ~/ -maxdepth 1 -fstype local -name "*.core" -delete

Now I get error messages saying "Access Denied" for directories that
find(1) should not access due to "-maxdepth 1". 

(Please do not ask why the user has directories within her/his $HOME
that she/he cannot access. :-)

Does the "-delete" primary lead to ignoring "-maxdepth 1"?

Thanks for your time, Marcus

Reply via email to