sql
This commit is contained in:
@@ -20,6 +20,8 @@ server=${credentials[server]}
|
||||
|
||||
postgres_con="psql -A -t postgresql://$user:$password@$host/$db"
|
||||
|
||||
$postgres_con -q -c "update fw_core.fw_jobctl_runschedule_jobstep set end_status_note ='Initial', end_status='success',end_time = now() where job_script_type = 'shell_script' and job_id = 1 and step_id= 1 and latest_runschedule_flag='1'"
|
||||
|
||||
count=`$postgres_con -c "select count(*) from fw_core.fw_jobctl_file_runschedule"`
|
||||
if [[ $count -eq 0 ]]
|
||||
then
|
||||
@@ -28,7 +30,7 @@ else
|
||||
while IFS= read -a filenames
|
||||
do
|
||||
file_name=$(echo $filenames | sed 's/[[:space:]]/\\ /g')
|
||||
if [ $(echo "-f $homeDir/files/landing/$file_name") ];
|
||||
if [[ -f $homeDir/files/landing/$filenames ]];
|
||||
then
|
||||
echo "File: $file_name is already processed and is moved to Duplicate Folder"
|
||||
move=$(echo "mv $homeDir/files/landing/$file_name $homeDir/files/duplicate_file/$file_name")
|
||||
|
||||
@@ -96,7 +96,7 @@ echo "Executing Job: $job_name by checking Previous End Status"
|
||||
psql $psql_base_arg -a -f $job_step_script_name $host $port $user $pwd $dbname $param $client_id $function_id $data_from_date $data_to_date $job_scope $job_scope_qualifier
|
||||
else
|
||||
chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=21 and function_id=1;")
|
||||
if [[ $file_count -gt 0 ]]; then
|
||||
if [[ "$chkrun" == " success" && $file_count -gt 0 ]]; then
|
||||
psql $psql_base_arg -a -f $job_step_script_name $host $port $user $pwd $dbname $param $client_id $function_id $data_from_date $data_to_date $job_scope $job_scope_qualifier
|
||||
else
|
||||
exit 1;
|
||||
@@ -111,7 +111,7 @@ echo "Executing Job: $job_name by checking Previous End Status"
|
||||
else
|
||||
chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=21 and function_id=1;")
|
||||
|
||||
if [[ $file_count -gt 0 ]]; then
|
||||
if [[ "$chkrun" == " success" && $file_count -gt 0 ]]; then
|
||||
$job_step_script_name
|
||||
else
|
||||
exit 1;
|
||||
@@ -126,7 +126,7 @@ echo "Executing Job: $job_name by checking Previous End Status"
|
||||
else
|
||||
|
||||
chkrun=$(psql $psql_base_arg -t -c "select TRIM(end_status) from fw_core.fw_jobctl_runschedule_jobstep where latest_runschedule_flag='1' and job_step_run_dependency_seuqence=$prev_job_seq and client_id=21 and function_id=1;")
|
||||
if [[ $file_count -gt 0 ]]; then
|
||||
if [[ "$chkrun" == " success" && $file_count -gt 0 ]]; then
|
||||
psql $psql_base_arg -t -c "select $job_step_script_name_concat"
|
||||
else
|
||||
exit 1;
|
||||
|
||||
Reference in New Issue
Block a user