1 |
ccflib |
1.1 |
#! /usr/local/bin/perl -w |
2 |
|
|
# |
3 |
|
|
# Giuseppe Vacanti (cosine science & computing bv) |
4 |
|
|
# |
5 |
ccflib |
1.4 |
# $Id: deleteccf,v 1.3 2003/10/31 15:52:32 ccflib Exp $ |
6 |
ccflib |
1.1 |
# |
7 |
ccflib |
1.4 |
# 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 |
ccflib |
1.1 |
require 5; |
11 |
|
|
use strict; |
12 |
ccflib |
1.3 |
use vars '%ENV'; |
13 |
|
|
use lib "$ENV{'HOME'}/cgi"; |
14 |
|
|
$ENV{'PATH'} .= "$ENV{'HOME'}/bin:"; |
15 |
ccflib |
1.1 |
use Ccflib; |
16 |
|
|
|
17 |
ccflib |
1.3 |
#chdir $Ccflib::develrm or die("Cannot access $Ccflib::develrm\n"); |
18 |
ccflib |
1.4 |
# 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 |
ccflib |
1.3 |
chdir "/home/ccflib/ftp-area/private/ccfdevel/deleted/" or die("Cannot access /home/ccflib/ftp-area/private/ccfdevel/deleted/\n"); |
22 |
ccflib |
1.1 |
|
23 |
|
|
my $deletes; |
24 |
|
|
foreach my $ccf (glob("*.CCF")){ |
25 |
|
|
qx/rm -f $ccf/; |
26 |
|
|
if(! $? >> 8){ |
27 |
|
|
warn("Deletion of $ccf failed\n"); |
28 |
|
|
} else { |
29 |
|
|
$deletes .= "$ccf "; |
30 |
|
|
} |
31 |
|
|
} |
32 |
ccflib |
1.3 |
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 |
ccflib |
1.1 |
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|