Forum Discussion
Backup F5 BigIP using RestAPI and PowerShell (again?)
- May 12, 2023
okay, I did that: https://stackoverflow.com/questions/76230777/bigip-f5-ucs-backup-via-restapi-and-powershell/76231795#76231795
Working on the last step - how to delete a file from UCS when it is downloaded.
Then - how to upload it to SharePoint, but this is another story and already completed 🙂
Roman_Melekh I'm glade this worked for you. You should be able to add onto the end of the script a command that issues a delete of the existing archive file, exactly the same as you did to create the file but in this case a delete. Good luck with the SharePoint piece and if you find that the primary issue has been resolved please mark the comment that solved this for you.
Yep, the command is here already:
function Delete-F5ArchiveFile
{
param
(
[Parameter(Mandatory = $true)][string]$token,
[Parameter(Mandatory = $true)][string]$server,
[Parameter(Mandatory = $true)][string]$UCSFileName
)
$headers = @{
"Content-Type" = "application/json"
"X-F5-Auth-Token" = "$token"
}
$body = @{
"command" = "run";
"utilCmdArgs" = " -c `"rm -f /var/local/ucs/$UCSFileName`" "
} | ConvertTo-Json
$result = Invoke-RestMethod -Uri "https://$server/mgmt/tm/util/bash" -Method Post -Headers $headers -Body $body
return $result
}Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com