Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
pedrobergo
Employee
Employee

How delete 7,000 files inside SaaS DataFiles Folder

Hi,

I generated (for testing purposes) many files inside SaaS DataFiles folder, about 7,000 qvds. I wanna delete them using a batch command or action, but wihtin SaaS only can delete them one-by-one.

How can I delete about  7.000 files from my tenant?

P.S. I seek a solution in QLIK-CLI, but i didn´t found any command to do that.  

Tks,

Pedro

Labels (1)
  • SaaS

21 Replies
pedrobergo
Employee
Employee
Author

Hi @pablolabbe 

See my github at https://github.com/pbergo/qlik-saas-utils and use the qlik_saas_delete.ps1 to remove these files.

You can pass the name of Space and file using wildcards to do that.

If you have any doubt, just  can call me on WP.

[]

Pedro

pablolabbe
Luminary Alumni
Luminary Alumni

You rock Pedro ! thank you !

didierodayo
Partner - Creator III
Partner - Creator III

Thanks Pedro

julian_rodriguez
Partner - Specialist
Partner - Specialist

Hello, I want to know if there is a command to copy QVD's between tenants or spaces.

Thanks

Peter-Lawlor
Contributor II
Contributor II

As do I - you cannot even delete the space  and start over (Not ideal tbh) due to the dependencies.

I tried to doctor the script above, but to no avail.  unsure if there is a permissions issue deleting Managed folder files.

pedrobergo
Employee
Employee
Author

Hi @julian_rodriguez 

I suggest you to open a new post that community can answer properly.

[],

Pedro

simonaubert
Partner - Specialist II
Partner - Specialist II

Hello @pedrobergo 

There is an idea to do it through script natively. Maybe that can interest you to vote for
https://community.qlik.com/t5/Suggest-an-Idea/Delete-Files-from-a-lib/idi-p/1689857

Best regards,

Simon

Bi Consultant (Dataviz & Dataprep) @ Business & Decision
Carl_Hunter
Partner Ambassador
Partner Ambassador

Did this API endpoint for CLI ever get released or documented? Can't see anything on Qlik.Dev 😞 be cool if app automations could do this... 

William_Wistam
Contributor III
Contributor III

Hi @Vincentzjecksen2021 

For the file name, you can try "findstr -c:ABC". 

I slightly modified @Levi_Turner  scripts above.

For dated 3 months and above, I am not sure yet, maybe date -gt from createdDate will work but need to parse the date from createdDate.

Hope this help.

$files = qlik raw get v1/qix-datafiles | ConvertFrom-Json | findstr -c:name | findstr -c:ABC

while ($($files.Length) -gt 1) {
    foreach ($file in $files) {
        Write-Host "Deleting $($file.name)"
        qlik raw delete v1/qix-datafiles/$($file.id) | Out-Null
    }
    $files = qlik raw get v1/qix-datafiles | ConvertFrom-Json
    Write-Host 'Next page'
}

 

Sample:

id : 9a8f8f48-4574-cba51320a453
name : ABC.qvd
size : 1470407
createdDate : 2022-10-17T04:48:10.964Z
modifiedDate : 2022-10-17T04:48:11.262Z
ownerId : 64226107810cefd90c

William_Wistam
Contributor III
Contributor III

Thank you @pedrobergo. In your github, I see upload and delete files. Is that possible to download files to local computer using these utilities? I spent hours yesterday trying to figure this out. Let me know. Thanks.