]>
git.ipfire.org Git - people/ms/nightly-builds.git/blob - server-scripts/ipfire-cleanup-nightly-builds.sh
5 MAX_AGE
=$
(( 7 * 24 * 3600 )) # 7 days
9 for branch
in $
(find "${BASEDIR}" -mindepth 1 -maxdepth 1 -type d
); do
12 for build
in $
(find "${branch}" -mindepth 1 -maxdepth 1 -type d |
sort -nr); do
13 time="$(basename "${build}")"
14 [ "${time}" = "latest" ] && continue
16 # Never delete the last two builds
17 if [ "${counter}" -lt 2 ]; then
18 counter
=$
(( ${counter} + 1 ))
22 # Determine age of the build
23 change
="$(stat --format="%Y
" "${build}")"
24 age
=$
(( ${NOW} - ${change} ))
26 # If the build is old enough we will delete it
27 if [[ ${age} -ge ${MAX_AGE} ]]; then