Exclude collection in mongodb backup

Hi,
I have a collection which weights couple of Go that can be generated from a program. Today, it is being backup, but it takes a lot more time to execute the backup with this collection included.
I know that there is an option to backup only specific collections, but I want to do the opposite, is there a way to do this using pbm ?

Thanks!

Hi Mike, I got it, but there’s no direct variable to do this. The only way is to use the –ns option to list all collections and databases except the one you don’t want to back up.

Also, if you can separate that collection into a new, empty database, your list will be smaller.

It is in its own database, but the thing is that we have new databases almost every day so list them all is impossible.
I wish there was the equivalent of the --ns option but to exclude.
Or maybe is it possible to revoke permissions on this specific database so that the backup user wouldn’t have access to it so he wouldn’t be able to backup it ?

Hey Mike,
Yeah, that would be hard to do that in your case, let me create a feature request for you, let’s see how it goes.

Here is the link that you can follow: Jira

1 Like