/[CCFs]/bin/cif_manager
ViewVC logotype

Annotation of /bin/cif_manager

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations)
Mon Mar 9 10:01:59 2015 UTC (9 years, 8 months ago) by ccflib
Branch: MAIN
Changes since 1.2: +4 -4 lines
fixed writing mtime to DELIVERY_LOG

1 ccflib 1.1 #! /bin/bash
2     #
3     # cif_manager
4     #
5     # This script does the following operations in sequence:
6     # 1) Gets the latest cif files created in the ftp-area/download subdirectory of ccflib
7     # on xvsoc01 by the cifbuild on-line tool included in the calibration section of web page
8     # 2) Registers any new *xmm-newton.cif files in the DELIVERY_LOG
9     # 3) Runs on xvsoc01 the scripts clean_cif_files and clean_uploaded_files
10     # to remove any *xmm-newton.cif and *uploaded.cif files older than 24 hrs
11     # 4) Cleans up the local ftp-area/download directory of any *.cif files older than 24 hrs.
12     #
13     # This script is run 15 min after the hour for all hours of day by cron.
14     #
15 ccflib 1.3 # $Id: cif_manager,v 1.2 2015/03/06 16:06:19 ccflib Exp $
16 ccflib 1.1
17    
18     # 1) Synchronizes both directories
19    
20     rsync -a -e ssh ccflib@xmm.esac.esa.int:/data/xmm/ftp/pub/ccf/download/ \
21     /home/ccflib/ftp-area/download/
22    
23    
24     # 2) Registers any new file in DELIVERY_LOG
25    
26 ccflib 1.2 for file in `ls -1tr /home/ccflib/ftp-area/download/*xmm-newton.cif`
27 ccflib 1.1 do
28 ccflib 1.3 filebase=`basename $file`
29     registered=`grep -c "$filebase" /home/ccflib/ftp-area/download/DELIVERY_LOG`
30 ccflib 1.1 [ "$registered" = "1" ] && continue
31     mtime=`stat --printf=%y $file | awk -F"." '{print $1}'`
32 ccflib 1.3 printf "%-40s %-10s %-10s\n" $filebase $mtime
33 ccflib 1.1 done >> /home/ccflib/ftp-area/download/DELIVERY_LOG
34    
35     # 3) Runs on xvsoc01 through ssh the clean_cif_files and clean_uploaded_files scripts
36    
37     ssh ccflib@xmm.esac.esa.int "/data/xmm/ccflib/bin/clean_cif_files"
38     ssh ccflib@xmm.esac.esa.int "/data/xmm/ccflib/bin/clean_uploaded_files"
39    
40     # 4) Cleans up any *.cif files older than 24hrs
41    
42     find /home/ccflib/ftp-area/download/ -type f -name "*.cif" -mtime +1 -exec rm {} \;
43    

  ViewVC Help
Powered by ViewVC 1.1.27