• Зачем это все?

    find /gitlab-runner/builds -type f -ctime +7 -delete && find /gitlab-runner/builds -type d -empty -delete
    Edited by Anatoly Kudryashov
  • This work for me:

    find /home/gitlab-runner/builds -type d -ctime +7 -not -path 'master' -not -path 'develop' -exec rm -Rf {} +

    I prefer to keep the master and develop folders.

  • I suggest to add some depth to this solution.

    find /home/gitlab-runner/builds -depth 2 -type d -ctime +7 -not -path 'master' -not -path 'develop' -exec rm -Rf {} +

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment