Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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

1 Solution

Accepted Solutions
Levi_Turner
Employee
Employee

 

$files = qlik raw get v1/qix-datafiles | ConvertFrom-Json

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'
}

 

 

Assumptions:

  1. The files exist inside of the user's Personal DataFiles
  2. The user wants all files gone

 

View solution in original post

21 Replies
Jeffrey_Goldberg
Employee
Employee

@pedrobergo , I can help you. I will dm you in the morning us east. Please install qlik-cli by following directions on https://qlik.dev.

regards,

@Jeffrey_Goldberg 

pedrobergo
Employee
Employee
Author

Hi @Jeffrey_Goldberg ,

Tks a lot. I consider that i´m have some know-how with qlik-cli, maybe not too much, but i´m already created scripts to upload automcatilly qvf, extensions, publish apps and sheets and create our demo environments.

Following directions on qlik.dev i didn´t found any mention about files manipulation. The 'qlik items ls | ConvertFrom-Json' command just response 'apps' resource-type. 

Tks in advance,

Pedro 

 

Levi_Turner
Employee
Employee

 

$files = qlik raw get v1/qix-datafiles | ConvertFrom-Json

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'
}

 

 

Assumptions:

  1. The files exist inside of the user's Personal DataFiles
  2. The user wants all files gone

 

Vincentzjecksen2021
Contributor
Contributor

Hi, I'm new to qlik cli, appreciate it if you can provide the command line that delete specific group of files for instance, need to delete a group of QVD files that start with ABC and dated 3 months and above. Is it possible to do so? thank you. 

Dalton_Ruer
Support
Support

I can't give you the script but yes that would be possible. The API for "qix-datafiles" returns the name of the file as well as the createdDate and modifiedDate depending on which you are trying to use. 

Dalton_Ruer_0-1616785965045.png

 

 

wwengso314
Contributor
Contributor

Hi, how can I delete the files in shared/managed spaces using qlik cli? Based on the above it is meant for the personal space only. 

didierodayo
Partner - Creator III
Partner - Creator III

Hi Jeffrey,

I have a similar situation with thousands of files I need to cleanup from a shared space. please are you able to share your script.

 

regards

Didier

roywinkelvicta
Partner - Contributor II
Partner - Contributor II

Hi Levi,

Do you know where i can find the v1/qix-datafiles endpoint documentation?

thx

pablolabbe
Luminary Alumni
Luminary Alumni

I have the same situation here with hundreds of files on a shared space that I need to delete. How to do it ?

Any thoughts @Levi_Turner , @Jeffrey_Goldberg  ?

Thanks !