Utility nz_cp_backup to upload/download backup to and from cloud to NPS#6
Open
nmahalle52 wants to merge 8 commits into
Open
Utility nz_cp_backup to upload/download backup to and from cloud to NPS#6nmahalle52 wants to merge 8 commits into
nmahalle52 wants to merge 8 commits into
Conversation
Member
|
@nmahalle52 add sample commands in PR description |
|
Does it copy everything? or there is a granularity ? |
Member
|
Comment from @aniket-s-kulkarni : change the name to |
aniket-s-kulkarni
suggested changes
Mar 15, 2021
Comment on lines
+23
to
+32
| var backupinfo Connector.BackupInfo | ||
| var connectorInfo Connector.ConnectorInfo | ||
| var otherargs Connector.OtherArgs | ||
| var err error | ||
| // parse input args | ||
| Connector.ParseArgs(&backupinfo, &connectorInfo, &otherargs) | ||
| flag.Parse() | ||
| Connector.SetUpLogFile(&backupinfo, &connectorInfo, &otherargs) | ||
| connector := Factory.GetConnector(connectorInfo.Connector) | ||
| parseConnectorArgs(connector, connectorInfo.ConnectorArgs) |
There was a problem hiding this comment.
Lets use Cobra for parsing here.
Lets make this
nzsyncbackup [upload|download|list] [aws-s3|azure-blob|ibm-cos]
# where connector args would be
# for aws s3
nzsyncbackup upload aws-s3 -h
Options
-------
-access-key <ACCESS-KEY> The access key for the object store [AWS_ACCESS_KEY_ID] (required)
-bucket-name <BUCKET-NAME> The name of the bucket to store backups to (required)
-region <REGION> The region of the object store bucket (required)
-secret-key <SECRET-KEY> The secret key for the object store [AWS_SECRET_ACCESS_KEY] (required)
--unique-id <id>
# .. similar options for ibm-cos
# for azure
nzsyncbackup upload azure-blob -h
Options
-------
-account-key <ACCOUNT-KEY> The Azure Blob account key (required)
-account-name <ACCOUNT-NAME> The Azure Blob account name (required)
-blob-type <BLOB-TYPE> The type of Azure Blob container. One of [block,page]
-bucket-name <BUCKET-NAME> The name of the bucket to store backups to (required)
-container <CONTAINER> The Azure Blob container name (required)
ditto for download and list
Contributor
Author
|
@Brajesh1984 : Utility has granularity , we can give increment number to upload or download particular increment . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: Currently we had nz_azconnector to upload and download backup from and to azure cloud. Needed the single utility to upload /download backup to azure as well as s3 cloud based on respective connector type.
Solution: Created utility which can be use to upload/download backup to cloud (/azure/S3) respectively based on connector type .
Testing: Tested below scenario:
TESTING S3:
1] Upload on prem backup to S3 cloud and Restore using S3 Connector:
2] Take multi dir backup, upload to S3 , S3 cloud restore:
3] Take backup on S3 of NPS and Download Backup to NPS host and restore on NPS:
4] Take PDA backup , upload to cloud , cloud restore to nps:
5] PDA cloud backup to S3, download to nps, and restore:
6] Tested Granularity with -increment
Testing Azure:
1] Upload on prem backup to Azure cloud and Restore using Azure Connector:
2] Take multi dir backup, upload to Azure , Azure cloud restore:
3] Take backup on Azure of NPS and Download Backup to NPS host and restore on NPS:
4] Take PDA backup , upload to cloud , cloud restore to nps
5] Tested Granularity with -increment
Sample Command :
Upload:
./main -db=MYDB1 -dir=/tmp/mydb1_backup -npshost=sim-ips21.fyre.ibm.com -increment 1 -backupset 20210311142047 -connector=az -connectorArgs="STORAGE_ACCOUNT:####;KEY:####;CONTAINER:quickstart;STREAMS:16;BLOCKSIZE:100" -logfiledir=. -upload -uniqueid=test50 -paralleljobs=10
Download:
./main -db=MYDB1 -dir=/tmp/mydb1_backupAZDownload -npshost=sim-ips21.fyre.ibm.com -increment 1 -backupset 20210311142047 -connector=az -connectorArgs="STORAGE_ACCOUNT:####;KEY:####;CONTAINER:quickstart;STREAMS:16;BLOCKSIZE:100" -logfiledir=. -download -uniqueid=test50 -paralleljobs=20
nzsyncbackup_Unit_Test.txt