2 |
# |
# |
3 |
# Giuseppe Vacanti (cosine science & computing bv) |
# Giuseppe Vacanti (cosine science & computing bv) |
4 |
# |
# |
5 |
# $Id: deleteccf,v 1.1 2002/03/18 18:28:57 ccflib Exp $ |
# $Id: deleteccf,v 1.3 2003/10/31 15:52:32 ccflib Exp $ |
6 |
# |
# |
7 |
|
# This script simply deletes all CCFs put in the subdir ccfdev/deleted, and it is intended to be run by |
8 |
|
# a crontab, either on xmm or in xvsas05. |
9 |
|
|
10 |
require 5; |
require 5; |
11 |
use strict; |
use strict; |
12 |
use lib "/data/xmm/ccflib/cgi"; |
use vars '%ENV'; |
13 |
use vars '%Env'; |
use lib "$ENV{'HOME'}/cgi"; |
14 |
$Env{'PATH'} .= "/data/xmm/ccflib/bin:"; |
$ENV{'PATH'} .= "$ENV{'HOME'}/bin:"; |
15 |
use Ccflib; |
use Ccflib; |
16 |
|
|
17 |
chdir $Ccflib::develrm or die("Cannot access $Ccflib::develrm\n"); |
#chdir $Ccflib::develrm or die("Cannot access $Ccflib::develrm\n"); |
18 |
|
# Ccflib.pm is located in $HOME/cgi and provides definitions of dircetories for ccflib |
19 |
|
# |
20 |
|
# Of course this is possible only on the host that knows where is /home/ccflib, not xvsoc01. |
21 |
|
chdir "/home/ccflib/ftp-area/private/ccfdevel/deleted/" or die("Cannot access /home/ccflib/ftp-area/private/ccfdevel/deleted/\n"); |
22 |
|
|
23 |
my $deletes; |
my $deletes; |
24 |
foreach my $ccf (glob("*.CCF")){ |
foreach my $ccf (glob("*.CCF")){ |
29 |
$deletes .= "$ccf "; |
$deletes .= "$ccf "; |
30 |
} |
} |
31 |
} |
} |
32 |
|
if($deletes){ |
33 |
|
print "The following constituents were found in the removed subdirectory:\n"; |
34 |
|
print "$deletes\n"; |
35 |
|
print "Now they have been definetely erased.\n"; |
36 |
|
} |
37 |
|
|
38 |
|
##my $x = qx/ccfnotify -t development -d $deletes/; |
39 |
|
## |
40 |
|
##if(! $? >> 8){ |
41 |
|
## warn("Notification failed\n"); |
42 |
|
##} |
43 |
|
|
44 |
|
|
45 |
|
|
|
my $x = qx/ccfnotify -t development -d $deletes/; |
|
46 |
|
|
|
if(! $? >> 8){ |
|
|
warn("Notification failed\n"); |
|
|
} |
|
47 |
|
|
48 |
|
|