1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/archbuild/files/clean-offload-build
Leonidas Spyropoulos dbef3bc895
archbuild: delete offload build directories not just artifacts
nullglob + loop so the service doesn't fail if there are no
 /home/*/.cache/offload-build directories (slightly less efficient
 that one find call, but seems safer also in regards to ARG_MAX)
-mindepth 1 so it doesn't try to delete .cache/offload-build for users
 without any recent builds
no verbose output from rm command, otherwise we'll get 500k log lines
 the first time it runs (calculated around 75G of old tmp directories)

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
Co-authored-by: Evangelos Foutras <evangelos@foutras.com>
2024-05-06 00:44:10 +01:00

9 lines
196 B
Bash
Executable File

#!/bin/bash
set -eu
shopt -s nullglob
for offload_build_cache in /home/*/.cache/offload-build; do
find "$offload_build_cache" -mindepth 1 -maxdepth 1 -type d -mtime +15 -exec rm -rf {} +
done