RSYNC_SRC=/srv/mirror/liveboot
RSYNC_FILTER=''
-# TODO: WORK IN PROGRESS
# ri server
RSYNC_DST1="liveboot@riserver/liveboot/"
# storage DC (mgmt11)
RSYNC_DST3="liveboot@10.254.1.1/liveboot/"
# staging (mgmt9)
RSYNC_DST4="liveboot@10.252.1.1/liveboot/"
+# TODO: DC1 + DC2
BUILD_SCRIPT=$(mktemp)
cat > $BUILD_SCRIPT <<-EOF
cd /srv/build/
sudo rm liveboot -Rf
+# TODO: implement better garbage collection, allow to keep images
+#
+# cleanup $RSYNC_SRC, keep MAX number of images
+#
+MAX=15
+cd $RSYNC_SRC
+COUNT=0
+for i in $(ls -atd1 ./liveboot-*) ; do
+ let COUNT=COUNT+1
+ if [ $COUNT -gt $MAX ] ; then
+ echo rm -rfv $i
+ else
+ echo "keeping $i"
+ fi
+done
+
#
# Mirror
#
echo "mirror to DCs is MISSING"
-# TODO: garbage collection
-#
-# cleanup /srv/mirror, keep MAX number of images
-#
-#MAX=15
-#cd $RSYNC_SRC
-#COUNT=0
-#for i in $(ls -atd1 ./${LIVE_TYPE}-*) ; do
-# let COUNT=COUNT+1
-# if [ $COUNT -gt $MAX ] ; then
-# rm -rfv $i
-# else
-# echo "keeping $i"
-# fi
-#done
-echo -n "cleanup DISABLED: "
du -sh /srv/mirror/liveboot
figlet "OK"