Answers: <h1><code>gitlab:cleanup</code></h1>
  <p>In order to clean up artifact storage post-restoration you'll need to run the following from the <a href="https://github.com/gitlabhq/gitlabhq/blob/master/doc/raketasks/cleanup.md" rel="nofollow noreferrer">gitlab:cleanup</a>, (you may want to try without <code>DRY_RUN=false</code> first).</p>
  <pre><code>sudo gitlab-rake gitlab:cleanup:orphan_job_artifact_files DRY_RUN=false
  </code></pre>
  <p>In the same light, you also remove uploaded files after the PITR backup,</p>
  <pre><code>sudo gitlab-rake gitlab:cleanup:project_uploads
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2023-03-10T18:37:32.680Z
Answers: 2023-03-10T18:37:32.680Z
Answers: Evan Carroll
Body: <p>If I have a two minio clusters,</p>
  <ul>
  <li>one running in production and,</li>
  <li>one running as a hot-backup streaming with <code>mc mirror</code>,</li>
  </ul>
  <p>And, if I have a point-in-time-backup running <code>gitaly-backup</code>. What happens if new artifacts are added <em>after</em> <code>gitaly-backup</code> is run? Are they effectively stranded? Does GitLab prune them by default? And if not, can I trigger a rpruning?</p>
  
Tags: <gitlab><backup>
Title: How does GitLab handle stranded (orphaned) artifacts in Object Store?
UserDisplayName: Evan Carroll
ThreadText: # How does GitLab handle stranded (orphaned) artifacts in Object Store?
  
  (Asked by: username_0 on 2023-03-10)
  
  If I have a two minio clusters,
  
  * one running in production and,
  * one running as a hot-backup streaming with `mc mirror`,
  
  And, if I have a point-in-time-backup running `gitaly-backup`. What happens if new artifacts are added *after* `gitaly-backup` is run? Are they effectively stranded? Does GitLab prune them by default? And if not, can I trigger a rpruning?
  
  **Tags:** gitlab, backup
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-03-10. Score: 0 | Accepted answer
  
  # `gitlab:cleanup`
  
  In order to clean up artifact storage post-restoration you'll need to run the following from the [gitlab:cleanup](https://github.com/gitlabhq/gitlabhq/blob/master/doc/raketasks/cleanup.md), (you may want to try without `DRY_RUN=false` first).
  
  ```
  sudo gitlab-rake gitlab:cleanup:orphan_job_artifact_files DRY_RUN=false
  
  ```
  
  In the same light, you also remove uploaded files after the PITR backup,
  
  ```
  sudo gitlab-rake gitlab:cleanup:project_uploads
  
  ```
  
  
  ---
  
  