FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 9148fdf6 authored by J.W. Smith's avatar J.W. Smith
Browse files

Date is now a command-line option (default today)

parent 6ae82047
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,8 @@ coordpath="/storage/app/EWS/General/EWS-Coordinator/"
configpath="$1"
todaydate="$2"
projectpath="$(perl -MPOSIX -e 'require $ARGV[0]; print get_project_path();' -- "$configpath")"
# Start log and check paths exist
......@@ -41,7 +43,7 @@ printf "${logstr1}" >> ${logfile}
#Checks to see if todays ENVIRONMENT data is available yet,
#if so, pulls it down
#and starts the portion of the EWS that runs on the Cambridge servers
${coordpath}ENVDataProcessor.pl ${configpath} >> ${logfile} 2>&1
${coordpath}ENVDataProcessor.pl ${configpath} ${todaydate} >> ${logfile} 2>&1
# check if perl script ran cleanly, 0 means success
if [ $? -ne 0 ]; then
......@@ -52,7 +54,7 @@ if [ $? -ne 0 ]; then
fi
logstr2="\n"
logstr2+="SurveyDataProcessor.pl finished cleanly.\n"
logstr2+="ENVDataProcessor.pl finished cleanly.\n"
logstr2+="=============\n"
printf "${logstr2}" >> ${logfile}
exit 0
......@@ -20,7 +20,7 @@ sub getTimestampNow {
}
my $debugTimeString = getTimestampNow();
my $debugOutput = 0;
my $debugOutput = 1;
my $debugNoFTPDownload = 0;
my $debugNoUpload = 0;
......@@ -41,7 +41,21 @@ my $coordinatorPath = dirname($configFilePath);
my $downloadFromWillow = get_download_from_willow();
my $todayString = DateTime->today(time_zone => "UTC")->strftime("%Y%m%d");
# get today's date from second command line argument
# (if not provided it will be undefined here)
my $todayString = shift;
# if date isn't an input argument, use today's date for operational
if (not defined $todayString) {
if($debugOutput) {
print("DEBUG: ".$debugTimeString." Date not provided as input argument, so using today's date.\n");
}
$todayString = DateTime->today(time_zone => "UTC")->strftime("%Y%m%d");
} else {
if($debugOutput) {
print("DEBUG: ".$debugTimeString." Date provided as input argument, working on ".$todayString."\n");
}
}
my $jobIDString = "ENVIRONMENT";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment