Skip to content
Snippets Groups Projects
Verified Commit dbef3bc8 authored by Leonidas Spyropoulos's avatar Leonidas Spyropoulos
Browse files

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: default avatarLeonidas Spyropoulos <artafinde@archlinux.org>
Co-authored-by: default avatarEvangelos Foutras <evangelos@foutras.com>
parent 5e31779a
No related branches found
No related tags found
No related merge requests found
#!/bin/bash -e
#!/bin/bash
find /home/*/.cache/offload-build/ -mtime +15 -name '*.pkg.tar*' -delete
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment