Qlik Community

Ask a Question

Deployment & Management

Discussion board where members learn more about Qlik Sense Installation, Deployment and Management.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
pedrobergo
Partner
Partner

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)
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

6 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
Partner
Partner
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

 

View solution in original post

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
Employee
Employee

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.