12 |
# |
# |
13 |
# This script is run 15 min after the hour for all hours of day by cron. |
# This script is run 15 min after the hour for all hours of day by cron. |
14 |
# |
# |
15 |
# $Id: cif_manager,v 1.1 2015/03/06 15:38:56 ccflib Exp $ |
# $Id: cif_manager,v 1.3 2015/03/09 10:01:59 ccflib Exp $ |
16 |
|
|
17 |
|
|
18 |
# 1) Synchronizes both directories |
# 1) Synchronizes both directories |
22 |
|
|
23 |
|
|
24 |
# 2) Registers any new file in DELIVERY_LOG |
# 2) Registers any new file in DELIVERY_LOG |
25 |
|
therearefiles=`ls -1tr /home/ccflib/ftp-area/download | grep -c xmm-newton.cif` |
26 |
for file in `ls -1tr /home/ccflib/ftp-area/download/*xmm-newton.cif` |
if [ "$therearefiles" != "0" ] ; then |
27 |
do |
for file in `ls -1tr /home/ccflib/ftp-area/download/*xmm-newton.cif` |
28 |
file=`basename $file` |
do |
29 |
registered=`grep -c "$file" /home/ccflib/ftp-area/download/DELIVERY_LOG` |
filebase=`basename $file` |
30 |
[ "$registered" = "1" ] && continue |
registered=`grep -c "$filebase" /home/ccflib/ftp-area/download/DELIVERY_LOG` |
31 |
mtime=`stat --printf=%y $file | awk -F"." '{print $1}'` |
[ "$registered" = "1" ] && continue |
32 |
printf "%-40s %-10s %-10s\n" $file $mtime |
mtime=`stat --printf=%y $file | awk -F"." '{print $1}'` |
33 |
done >> /home/ccflib/ftp-area/download/DELIVERY_LOG |
printf "%-40s %-10s %-10s\n" $filebase $mtime |
34 |
|
done >> /home/ccflib/ftp-area/download/DELIVERY_LOG |
35 |
|
fi |
36 |
|
|
37 |
# 3) Runs on xvsoc01 through ssh the clean_cif_files and clean_uploaded_files scripts |
# 3) Runs on xvsoc01 through ssh the clean_cif_files and clean_uploaded_files scripts |
38 |
|
|