Daily cron job script unnecessarily executes `find` with `rm` instead of using its '-delete' action

Bug #1954311 reported by Akbarkhon Variskhanov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
New
Undecided
Unassigned

Bug Description

Executing `rm` as a separate process each time for every single file is unnecessary and inefficient. The option '-delete' should be used instead.

Patch is included below.

Tags: patch
Revision history for this message
Akbarkhon Variskhanov (kbar) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "apport.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Akbarkhon Variskhanov (kbar) wrote :

Also removed -prune primary as it conflicted with -depth, which is automatically turned on by -delete.

Revision history for this message
Akbarkhon Variskhanov (kbar) wrote (last edit ):

Replaced -prune with -maxdepth 1 because -delete automatically turns on -depth.

Reverted the second command back to its original state as -delete can't delete directories that aren't empty.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.