projects
/
grml-live-grml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update changelog for issue664
[grml-live-grml.git]
/
buildd
/
cleanup.sh
diff --git
a/buildd/cleanup.sh
b/buildd/cleanup.sh
index
79c1223
..
f9e72b1
100755
(executable)
--- a/
buildd/cleanup.sh
+++ b/
buildd/cleanup.sh
@@
-4,34
+4,41
@@
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2 or any later version.
-# Latest change: Sun Oct 7 09:29:22 UTC 2007 [mika]
################################################################################
set -e
################################################################################
set -e
+. /etc/grml/grml-buildd.conf
+
+[ -n "$MIRROR_DIRECTORY" ] || exit 1
+cd $MIRROR_DIRECTORY || exit 2
+
# we want to always keep a few images, no matter how old they are
# but get rid of the oldest ones first of course :)
# we want to always keep a few images, no matter how old they are
# but get rid of the oldest ones first of course :)
-# so: how many images do we want to keep?
+# so: how many images do we want to keep?
DAYS=3 usually means 'keep 4 images'
DAYS=3
REMOVE_ME=""
DAYS=3
REMOVE_ME=""
-for flavour in grml-medium_etch grml-medium_sid grml64-medium_etch grml64-medium_sid grml64_sid grml_sid ; do
- FILE_COUNT=$(ls -1 $flavour*.iso | wc -l)
+for flavour in grml-small_lenny grml-small_sid grml-medium_lenny grml-medium_sid grml_sid grml_lenny \
+ grml64-small_lenny grml64-small_sid grml64-medium_lenny grml64-medium_sid grml64_sid grml64_lenny ; do
+ FILE_COUNT=$(ls -1 $flavour/$flavour*.iso | wc -l)
if [ "$FILE_COUNT" -gt "$DAYS" ] ; then
if [ "$FILE_COUNT" -gt "$DAYS" ] ; then
- FILES=$(ls -1 $flavour*.iso | tail -"$DAYS")
- OLD_FILES=$(ls $flavour*.iso | grep -v "$FILES")
+ FILES=$(ls -1 $flavour
/$flavour
*.iso | tail -"$DAYS")
+ OLD_FILES=$(ls $flavour
/$flavour
*.iso | grep -v "$FILES")
for file in $OLD_FILES ; do
for file in $OLD_FILES ; do
- REMOVE_ME="$REMOVE_ME $(find
$file
-mtime +$DAYS)"
+ REMOVE_ME="$REMOVE_ME $(find
"$file"
-mtime +$DAYS)"
done
fi
done
done
fi
done
-[ -d .
delete ] || mkdir .delet
e
+[ -d .
archive ] || mkdir .archiv
e
-# move them before we really delete them:
for file in $REMOVE_ME ; do
for file in $REMOVE_ME ; do
- test -f ${file} && mv $file .delete
- test -f ${file}.md5 && mv ${file}.md5 .delete
+ # remove ISOs:
+ test -f "${file}" && rm -f "$file"
+ # ... but keep their md5sum / sha1sum:
+ test -f "${file}".md5 && mv "${file}".md5 .archive
+ test -f "${file}".sha1 && mv "${file}".sha1 .archive
done
# inform on successful removal:
done
# inform on successful removal:
@@
-39,4
+46,4
@@
if [ "$(echo "$REMOVE_ME" | tr -d ' ' )" != "" ] ; then
echo "deleted files $REMOVE_ME" | mail -s "daily-builds cleanup script" mika@grml.org
fi
echo "deleted files $REMOVE_ME" | mail -s "daily-builds cleanup script" mika@grml.org
fi
-#
EOF
+#
# END OF FILE #################################################################