--- bin/deleteccf 2013/02/14 14:26:44 1.4 +++ bin/deleteccf 2014/12/02 14:06:51 1.5 @@ -1,24 +1,25 @@ #! /usr/local/bin/perl -w # -# Giuseppe Vacanti (cosine science & computing bv) +# $Id: deleteccf,v 1.4 2013/02/14 14:26:44 ccflib Exp $ # -# $Id: deleteccf,v 1.3 2003/10/31 15:52:32 ccflib Exp $ -# -# This script simply deletes all CCFs put in the subdir ccfdev/deleted, and it is intended to be run by -# a crontab, either on xmm or in xvsas05. +# 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 vars '%ENV'; use lib "$ENV{'HOME'}/cgi"; $ENV{'PATH'} .= "$ENV{'HOME'}/bin:"; -use Ccflib; -#chdir $Ccflib::develrm or die("Cannot access $Ccflib::develrm\n"); -# Ccflib.pm is located in $HOME/cgi and provides definitions of dircetories for ccflib -# -# Of course this is possible only on the host that knows where is /home/ccflib, not xvsoc01. -chdir "/home/ccflib/ftp-area/private/ccfdevel/deleted/" or die("Cannot access /home/ccflib/ftp-area/private/ccfdevel/deleted/\n"); +# Can not use Ccflib.pm located in $HOME/cgi because it has definitions for directories only on xvsoc01. +# use Ccflib; + +my $host=qx/hostname | cut -d. -f1/ ; +my $homedir="/home/ccflib" ; +chomp($host); +$homedir="/data/xmm/ccflib" if ( $host eq "xvsoc01" ) ; + +chdir "$homedir/ftp-area/private/ccfdevel/deleted/" ; my $deletes; foreach my $ccf (glob("*.CCF")){