From 823380f86420fdc9ccfefde601a49d5f4837431d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 6 Mar 2020 11:12:55 +0100 Subject: build-isos: remove old isos from the mirror iff they are in the archive --- build-isos | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'build-isos') diff --git a/build-isos b/build-isos index a637427..6843fe1 100755 --- a/build-isos +++ b/build-isos @@ -4,6 +4,7 @@ set -e +archive='/mnt/archlinux32archive' destination='/mnt/archlinux32/archisos' base_dir=$( readlink -e "${0%/*}" @@ -74,6 +75,13 @@ case "$(hostname -s)" in git -C "${base_dir}/../archweb32" commit 'download/index.html' -m 'download/index.html: new isos ('"${date}"')' git -C "${base_dir}/../archweb32" push + find "${destination}" -name 'archlinux-*' -not -name 'archlinux-'"${date}"'-*' \ + | while read -r to_delete; do + if diff -q "${to_delete}" "${archive}/iso/${to_delete#${destination}/}"; then + rm "${to_delete}" + fi + done + echo '... done.' ;; 'nlopc46') -- cgit v1.2.3-70-g09d2