I'm trying to see how using jetbackup5api I can create a full backup, of type download.
It is true that it could well be done in another way since the objective is:
- Create a complete backup although the last complete backup could also be used (the first option is preferable, since the execution, I suppose, will return the information of the result with its incidents)
- Obtain the backup information to transfer it to a glacier backup.
It is an operation that my client wants when he cancels an account, and he wants to keep the last backup file for 5 years.
Help appreciated.
Logic for create download backup form API 5
-
- Staff Member
- Posts: 74
- Joined: August 5th, 2022, 11:01 pm
Re: Logic for create download backup form API 5
Hello castris,
To start with, we are going to need to get the account ID belonging to the account we wish to download a backup for. We can get this using the listAccounts API call.
This should provide you with the following output:
The '_id' is the string that you are looking for. From this call, we can use the account ID for the listBackups call to find available backups for the desired account. An example call would be requesting all full account backups for our desired account using the following:
Once you have the "parent_id" of the desired backup, you can generate a download of this backup using the following API call:
Make sure that you use the "parent_id" from the desired backup in the "snapshot_id" section of the download API call.
To start with, we are going to need to get the account ID belonging to the account we wish to download a backup for. We can get this using the listAccounts API call.
Code: Select all
jetbackup5api -F listAccounts | grep -w 'username: {account_name}' -B 2
Code: Select all
_id: 646e89d7fd06cbf8060d3ce3
uuid: 3abae668b85f36fe202590c3706987d750dfb0d8
username: {account_name}
Code: Select all
jetbackup5api -F listBackups -D 'type=1&contains=511&account_id={account_id}' | grep 'parent_id'
Code: Select all
jetbackup5api -F addQueueItems -D 'type=4&snapshot_id={parent_id}'
Thank you,
Adam G
JetApps, LLC.
JetApps.com | JetBackup.com
Adam G
JetApps, LLC.
JetApps.com | JetBackup.com
Re: Logic for create download backup form API 5
A lot of thanks.