Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 1788d4de authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Ajout de l'option STARTAT

parent e597242c
...@@ -163,6 +163,9 @@ pack_and_send() { ...@@ -163,6 +163,9 @@ pack_and_send() {
NETWORK=${YNS[-2]} NETWORK=${YNS[-2]}
STATION=${YNS[-1]} STATION=${YNS[-1]}
KEY=${YEAR}_${NETWORK}_${STATION} KEY=${YEAR}_${NETWORK}_${STATION}
if [[ $YEAR -lt $RESIFDD_START_AT ]]; then
return 0
fi
echo "[$KEY] Starting job $2" echo "[$KEY] Starting job $2"
# Test if in recovery mode, we should send or not # Test if in recovery mode, we should send or not
if [[ -r $RECOVERY_FILE ]]; then if [[ -r $RECOVERY_FILE ]]; then
...@@ -173,8 +176,8 @@ pack_and_send() { ...@@ -173,8 +176,8 @@ pack_and_send() {
fi fi
fi fi
echo "[$KEY] Creating tar on $RESIFDD_WORKDIR/$KEY.tar" echo "[$KEY] Creating tar on $RESIFDD_WORKDIR/$KEY.tar"
echo "[$KEY] tar cf $RESIFDD_WORKDIR/$KEY.tar -C ${dir%$YEAR/$NETWORK/$STATION} $YEAR/$NETWORK/$STATION" echo "[$KEY] tar cf $RESIFDD_WORKDIR/$KEY.tar -C ${dir%$YEAR/$NETWORK/$STATION} ./$YEAR/$NETWORK/$STATION"
tar cf $RESIFDD_WORKDIR/$KEY.tar -C ${dir%$YEAR/$NETWORK/$STATION} $YEAR/$NETWORK/$STATION tar cf $RESIFDD_WORKDIR/$KEY.tar -C ${dir%$YEAR/$NETWORK/$STATION} ./$YEAR/$NETWORK/$STATION
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
# Something went wrong creating archive. Exit # Something went wrong creating archive. Exit
echo "[$KEY] Error 007 creating tar" echo "[$KEY] Error 007 creating tar"
...@@ -195,6 +198,7 @@ pack_and_send() { ...@@ -195,6 +198,7 @@ pack_and_send() {
echo "[$KEY] The archive on irods is the same as our version. Skipping." echo "[$KEY] The archive on irods is the same as our version. Skipping."
SIZE=$(stat -c %s $RESIFDD_WORKDIR/$KEY.tar) SIZE=$(stat -c %s $RESIFDD_WORKDIR/$KEY.tar)
format_report $KEY $(($SIZE/1024/1024)) $(date +%Y-%m-%dT%H:%M:%S) "-" "-" "Skipped" >> $LOCAL_REPORT format_report $KEY $(($SIZE/1024/1024)) $(date +%Y-%m-%dT%H:%M:%S) "-" "-" "Skipped" >> $LOCAL_REPORT
rm $RESIFDD_WORKDIR/$KEY*
return 0 return 0
fi fi
fi fi
...@@ -232,6 +236,7 @@ if [[ ! -d $RESIFDD_DATADIR ]]; then ...@@ -232,6 +236,7 @@ if [[ ! -d $RESIFDD_DATADIR ]]; then
exit 1 exit 1
fi fi
#################### ####################
# #
# Option ContinueFrom # Option ContinueFrom
...@@ -243,14 +248,15 @@ if [[ -r ${RESIFDD_CONTINUE_FROM_FILE} ]]; then ...@@ -243,14 +248,15 @@ if [[ -r ${RESIFDD_CONTINUE_FROM_FILE} ]]; then
cp $RESIFDD_CONTINUE_FROM_FILE $RESIFDD_WORKDIR/recovery.$$ cp $RESIFDD_CONTINUE_FROM_FILE $RESIFDD_WORKDIR/recovery.$$
RECOVERY_FILE=$RESIFDD_WORKDIR/recovery.$$ RECOVERY_FILE=$RESIFDD_WORKDIR/recovery.$$
echo "Now using $RESIFDD_WORKDIR/recovery.$$ as recovery file" echo "Now using $RESIFDD_WORKDIR/recovery.$$ as recovery file"
LOCAL_REPORT=$RESIFDD_CONTINUE_FROM_FILE
else else
echo "No recovery file present. Dumping everything now" echo "No recovery file present. Dumping everything now"
LOCAL_REPORT=$RESIFDD_WORKDIR/report_$(date +%Y%m%d-%H%M).csv
format_report "Year_Network_Station" "Size(MB)" "Dumpdate" "Duration(s)" "Throughput(MB/s)" "Comment" > $LOCAL_REPORT
fi fi
# Header for the report : # Header for the report :
IRODS_REPORT=reports/$(date +%Y%m%d-%H%M).csv IRODS_REPORT=reports/$(date +%Y%m%d-%H%M).csv
LOCAL_REPORT=$RESIFDD_WORKDIR/report_$(date +%Y%m%d-%H%M).csv
format_report "Year_Network_Station" "Size(MB)" "Dumpdate" "Duration(s)" "Throughput(MB/s)" "Comment" > $LOCAL_REPORT
imkdir -p reports imkdir -p reports
iput -f $LOCAL_REPORT $IRODS_REPORT iput -f $LOCAL_REPORT $IRODS_REPORT
rm $RESIFDD_WORKDIR/report.lock rm $RESIFDD_WORKDIR/report.lock
...@@ -298,5 +304,5 @@ if [[ ! -d $SNAPSHOT_DIR ]]; then ...@@ -298,5 +304,5 @@ if [[ ! -d $SNAPSHOT_DIR ]]; then
fi fi
echo "Starting dump of validated data with 4 jobs" echo "Starting dump of validated data with 4 jobs"
find $SNAPSHOT_DIR -maxdepth 3 -mindepth 3 -type d | sort | parallel --jobs 4 --max-args 1 pack_and_send {} {%} find $SNAPSHOT_DIR -maxdepth 3 -mindepth 3 -type d | sort | parallel --jobs 6 --max-args 1 pack_and_send {} {%}
echo "Dump of validated data done" echo "Dump of validated data done"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment