Adding multi-bucket support for cbbackup
Summary:
While doing backups using cbbackup we have only two options when choosing the bucket_source: either all buckets or only single bucket. So:
- choosing the option of
all buckets(which is default if you don't specify any buckets) we're getting the backup of all buckets, without option to choose which buckets you would like to skip. - choosing the option of
custom bucketby adding arg-b bucket_namewe are limited to only one bucket per backup.
Problem:
When having a custom list -b bucket_1 -b bucket_2 -b bucket_3 of buckets that we want to backup, there is no option to specify them. We can automate this by a loop:
buckets = [ "bucket_1", "bucket_2", "bucket_3" ]
for bucket in buckets:
cbbackup http://[host]:[port] /path/for/backup` -u [user] -p [password] -b bucket
and perform backup for each bucket separately, but this will create a new folder for each bucket with timestamp and other two subfolders. When having multiple Couchbase clusters, using the aforementioned loop and multiple folders would create a mess and would be hard to understand which backup (folder) is for which bucket.
Steps to reproduce
In order to reproduce, you can run the following command: cbbackup http://[host]:[port] /path/for/backup -u [user] -p [password] -b bucket_1 -b bucket_2 -b bucket_3. What you will get is the backup for the last bucket specified, in our case backup for only bucket_3`.
Potential solution:
In this PR we are adding support for multiple buckets: cbbackup http://[host]:[port] /path/for/backup -u [user] -p [password] -b bucket_1 -b bucket_2 -b bucket_3. By doing this, user will be able to create single backup of multiple buckets in a single folder with the timestamp on it.
hi @mikewied, are you the right person to take a look at this PR? Thanks