Percona-Lab / mongodb_consistent_backup

A tool for performing consistent backups of MongoDB Clusters or Replica Sets
https://www.percona.com
Apache License 2.0
276 stars 81 forks source link

Rotate: Wrapping the rotate removal under a try-catch block. #278

Closed corey-hammerton closed 5 years ago

corey-hammerton commented 5 years ago

The original code would raise an OperationError is the backup path doesn't exist. This is not the only reason a rmtree would fail, insufficient permissions, invalid SELinux contexts, etc. This commit wraps the rmtree functionality in a try-catch block to catch and log any exceptions that may happen.

timvaillancourt commented 5 years ago

LGTM, thanks @corey-hammerton