From 454c38ded8c236bef8b3939ad0c43b3dfc652fc4 Mon Sep 17 00:00:00 2001 From: Geert-Jan Giezeman Date: Fri, 18 Feb 2000 09:03:08 +0000 Subject: [PATCH] Utility to remove testresults from web server and move them to archive. --- Packages/Maintenance/test_handling/empty_dir | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 Packages/Maintenance/test_handling/empty_dir diff --git a/Packages/Maintenance/test_handling/empty_dir b/Packages/Maintenance/test_handling/empty_dir new file mode 100755 index 00000000000..eda753406c1 --- /dev/null +++ b/Packages/Maintenance/test_handling/empty_dir @@ -0,0 +1,33 @@ +#!/bin/sh + +old_results_dir=/projects/CGAL/old_results + +if [ -d "$1" ] ; then + if [ -d "$1/Polygon" -o -d "$1/src" ] ; then + if [ -x "$1" ] ; + then + cp -r "$1" $old_results_dir + find "$old_results_dir/$1" -name '*.gz' | xargs gunzip + (cd $old_results_dir; tar cf /projects/CGAL/old_results/$1.tar $1) + if gzip --best /projects/CGAL/old_results/$1.tar + then + chgrp cgal /projects/CGAL/old_results/$1.tar.gz + chmod g+w /projects/CGAL/old_results/$1.tar.gz + rm -r /projects/CGAL/old_results/$1 + cd $1 + rm */* ; + rmdir * 2>/dev/null + else + echo "Could not gzip /projects/CGAL/old_results/$1.tar " >&2 + rm -r /projects/CGAL/old_results/$1 + fi + else + echo "Could not cd to $1" >&2 + fi + else + echo "$1 seems to be emptied already" >&2 + fi +else + echo "$1 is not a directory" >&2 +fi +