[Evolvis-commits] r228: optimise daily SVN snapshot generation↵

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Jan 11 10:48:20 CET 2010


Author: mirabilos
Date: 2010-01-11 09:48:18 +0000 (Mon, 11 Jan 2010)
New Revision: 228

Modified:
   trunk/gforge_base/gforge-4.8.1+evolvis/debian/changelog
   trunk/gforge_base/gforge-4.8.1+evolvis/plugins/scmsvn/cronjobs/snapshots.sh
Log:
optimise daily SVN snapshot generation


Modified: trunk/gforge_base/gforge-4.8.1+evolvis/debian/changelog
===================================================================
--- trunk/gforge_base/gforge-4.8.1+evolvis/debian/changelog	2009-12-30 12:31:30 UTC (rev 227)
+++ trunk/gforge_base/gforge-4.8.1+evolvis/debian/changelog	2010-01-11 09:48:18 UTC (rev 228)
@@ -1,8 +1,16 @@
 gforge (4.8.1+evolvis-14) xunstable; urgency=low
 
   * fix shortcut icon and favicon use
+  * plugins/scmsvn/cronjobs/snapshots.sh: couple of improvements:
+    • use 'gzip -n9 --rsyncable' if available, 'gzip -n9' if not,
+      instead of the default 'gzip -6', and allow use of LZMA and
+      XZ (once released) via a commented-out example
+    • provide migration path between .tar.gz and .tar.lzma/xz
+    • remove checkouts once compressed, instead of all of them at
+      once at the end of the operation, to mitigate disc capacity
+      problems due to the sheer size of these temporary sandboxen
 
- -- Thorsten Glaser <t.glaser at tarent.de>  Wed, 30 Dec 2009 13:30:44 +0100
+ -- Thorsten Glaser <t.glaser at tarent.de>  Mon, 11 Jan 2010 10:37:07 +0100
 
 gforge (4.8.1+evolvis-12) unstable; urgency=low
 

Modified: trunk/gforge_base/gforge-4.8.1+evolvis/plugins/scmsvn/cronjobs/snapshots.sh
===================================================================
--- trunk/gforge_base/gforge-4.8.1+evolvis/plugins/scmsvn/cronjobs/snapshots.sh	2009-12-30 12:31:30 UTC (rev 227)
+++ trunk/gforge_base/gforge-4.8.1+evolvis/plugins/scmsvn/cronjobs/snapshots.sh	2010-01-11 09:48:18 UTC (rev 228)
@@ -18,6 +18,15 @@
 SCMSNAPSHOTSDIR=/var/lib/gforge/scmsnapshots
 TMPDIR=/tmp
 
+compressor='gzip -n9'
+gzip -h 2>&1 | fgrep rsyncable >/dev/null 2>&1 && \
+    compressor="$compressor --rsyncable"
+filext=gz
+#compressor='lzma -9'
+#filext=lzma
+#compressor='xz -C crc32 -9e'
+#filext=xz
+
 case "$1" in
     generate)
 	# Create temporary dir
@@ -33,8 +42,11 @@
 	    cd $work_dir
 	    svn checkout -q file://$SVNROOT/$dir/trunk $dir-scm-$today 2>/dev/null || 
 	    ( rm -fr $dir-scm-$today; svn checkout -q file://$SVNROOT/$dir $dir-scm-$today)
-            tar czf $dir-scm-latest.tar.gz $dir-scm-$today
-            mv $dir-scm-latest.tar.gz $SCMSNAPSHOTSDIR
+	    tar -cf - $dir-scm-$today | $compressor >$dir-scm-latest.tar.$filext
+	    rm -f $SCMSNAPSHOTSDIR/$dir-scm-latest.tar.*
+	    mv $dir-scm-latest.tar.$filext $SCMSNAPSHOTSDIR/
+	    cd $work_dir
+	    rm -rf $dir-scm-$today
         done
         ;;
 




More information about the evolvis-commits mailing list