How do I retrieve Job artifacts from when they were deleted?

My project has 45mb of files but uses 21 GB of storage. I would like to clean that up.

I was unlucky and I assumed that deleting the jobs the artifacts would be gone, but they didn’t. Then I saw that almost every solution for this requires two steps, a script in browser console to retrieve all jobs + a script that takes that list of jobs and deletes it. Because I’m made impossible the first step, I’ve tried a brute force script in this topic here:

That didn’t work, because since I’m using public runners I’m trying to guess and delete all jos one by one using a range loop from my first pipeline number from 12 -16 months ago until now, there are 150.0000 possibilities. My loop was running for 4 days and didn’t catch anything until it crashed.

Summary: I just really need to retrieve all job IDS via command line considering that they were deleted to delete their artifacts , or some sort of reset that will cleanup all previous pipelines

Hi Daniel,

I follow your posts with compassion. It seems to be really a problem. Other users complain too: Repo Storage keeps growing despite jobs expiring

Have you tried jobs API, You are supposed to get there a list of all jobs with their IDs.


1 Like

Thank you Alexk :slight_smile: ,
I tried before but it didn’t work, I will try again.

My script has been running for 7 days already and nothing was deleted, still bruteforcing on a gigantic loop

Hi Daniel,

I looked into the issue, and it seems to me that you can do nothing here. It looks like a GitLab bug,

Gotcha, @alexk
Thank you