--- bin/deleteccf 2002/03/19 15:05:09 1.2 +++ bin/deleteccf 2018/01/15 10:02:11 1.6 @@ -1,17 +1,25 @@ -#! /usr/local/bin/perl -w +#! /xdata/ccflib/perl5/perlbrew/perls/perl-5.18.4/bin/perl -w # -# Giuseppe Vacanti (cosine science & computing bv) -# -# $Id: deleteccf,v 1.1 2002/03/18 18:28:57 ccflib Exp $ +# $Id: deleteccf,v 1.5 2014/12/02 14:06:51 ccflib Exp $ # +# This script simply deletes all CCFs put in the subdir ccfdev/deleted. +# It is intended to be run by a crontab, either on xvsoc01 or in sasbld01 + require 5; use strict; -use lib "/data/xmm/ccflib/cgi"; -use vars '%Env'; -$Env{'PATH'} .= "/data/xmm/ccflib/bin:"; -use Ccflib; +use vars '%ENV'; +use lib "$ENV{'HOME'}/cgi"; +$ENV{'PATH'} .= "$ENV{'HOME'}/bin:"; + +# Can not use Ccflib.pm located in $HOME/cgi because it has definitions for directories only on xvsoc01. +# use Ccflib; + +my $host=qx/\/bin\/hostname | cut -d. -f1/ ; +my $homedir="/home/ccflib" ; +chomp($host); +$homedir="/data/xmm/ccflib" if ( $host eq "xvsoc01" ) ; -chdir $Ccflib::develrm or die("Cannot access $Ccflib::develrm\n"); +chdir "$homedir/ftp-area/private/ccfdevel/deleted/" ; my $deletes; foreach my $ccf (glob("*.CCF")){ @@ -22,11 +30,20 @@ $deletes .= "$ccf "; } } +if($deletes){ + print "The following constituents were found in the removed subdirectory:\n"; + print "$deletes\n"; + print "Now they have been definetely erased.\n"; +} + +##my $x = qx/ccfnotify -t development -d $deletes/; +## +##if(! $? >> 8){ +## warn("Notification failed\n"); +##} + + -my $x = qx/ccfnotify -t development -d $deletes/; -if(! $? >> 8){ - warn("Notification failed\n"); -}