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.2 2015/03/06 16:06:19 ccflib Exp $ |
16 |
|
|
17 |
|
|
18 |
# 1) Synchronizes both directories |
# 1) Synchronizes both directories |
25 |
|
|
26 |
for file in `ls -1tr /home/ccflib/ftp-area/download/*xmm-newton.cif` |
for file in `ls -1tr /home/ccflib/ftp-area/download/*xmm-newton.cif` |
27 |
do |
do |
28 |
file=`basename $file` |
filebase=`basename $file` |
29 |
registered=`grep -c "$file" /home/ccflib/ftp-area/download/DELIVERY_LOG` |
registered=`grep -c "$filebase" /home/ccflib/ftp-area/download/DELIVERY_LOG` |
30 |
[ "$registered" = "1" ] && continue |
[ "$registered" = "1" ] && continue |
31 |
mtime=`stat --printf=%y $file | awk -F"." '{print $1}'` |
mtime=`stat --printf=%y $file | awk -F"." '{print $1}'` |
32 |
printf "%-40s %-10s %-10s\n" $file $mtime |
printf "%-40s %-10s %-10s\n" $filebase $mtime |
33 |
done >> /home/ccflib/ftp-area/download/DELIVERY_LOG |
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 |
# 3) Runs on xvsoc01 through ssh the clean_cif_files and clean_uploaded_files scripts |