/[CCFs]/bin/deleteccf
ViewVC logotype

Diff of /bin/deleteccf

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by ccflib, Thu Feb 14 14:26:44 2013 UTC revision 1.7 by ccflib, Sat Jul 4 11:59:30 2020 UTC
# Line 1  Line 1 
1  #! /usr/local/bin/perl -w  #! /xdata/ccflib/perl5/perlbrew/perls/perl-5.18.4/bin/perl -w
2  #  #
3  # Giuseppe Vacanti (cosine science & computing bv)  # $Id: deleteccf,v 1.6 2018/01/15 10:02:11 ccflib Exp $
4  #  #
5  # $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.
 #  
 # 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.  
6    
7  require 5;  require 5;
8  use strict;  use strict;
9  use vars '%ENV';  use vars '%ENV';
10  use lib "$ENV{'HOME'}/cgi";  use lib "$ENV{'HOME'}/cgi";
11  $ENV{'PATH'} .= "$ENV{'HOME'}/bin:";  $ENV{'PATH'} .= "$ENV{'HOME'}/bin:";
 use Ccflib;  
12    
13  #chdir $Ccflib::develrm or die("Cannot access $Ccflib::develrm\n");  
14  # Ccflib.pm is located in $HOME/cgi and provides definitions of dircetories for ccflib  my $host=qx/\/bin\/hostname | cut -d. -f1/ ;
15  #  my $homedir="/home/ccflib" ;
16  # Of course this is possible only on the host that knows where is /home/ccflib, not xvsoc01.  chomp($host);
17  chdir "/home/ccflib/ftp-area/private/ccfdevel/deleted/" or die("Cannot access /home/ccflib/ftp-area/private/ccfdevel/deleted/\n");  
18    chdir "$homedir/ftp-area/private/ccfdevel/deleted/" ;
19    
20  my $deletes;  my $deletes;
21  foreach my $ccf (glob("*.CCF")){  foreach my $ccf (glob("*.CCF")){
22    qx/rm -f $ccf/;    qx/rm -f $ccf/ if ($ccf);
23    if(! $? >> 8){    if(! $? >> 8){
24      warn("Deletion of $ccf failed\n");      warn("Deletion of $ccf failed\n");
25    } else {    } else {
# Line 40  if($deletes){ Line 37  if($deletes){
37  ##if(! $? >> 8){  ##if(! $? >> 8){
38  ##  warn("Notification failed\n");  ##  warn("Notification failed\n");
39  ##}  ##}
   
   
   
   
   
   

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.27