OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
bin
/
etl_odbc
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📄
-d
10 bytes
02/03/2023 07:34:13 AM
rw-r--r--
📁
..
-
02/03/2023 08:06:37 AM
rwxr-xr-x
📄
config.pl
7.61 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
cross2normal.pl
3.71 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
dataextract.sh
2.51 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
etl.pl
5.42 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
etlproc
9.99 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
func.pl
4.01 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
globvar.sh
127 bytes
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
initetl.pl
1.88 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
libawk.awk
3.07 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
makeXtab2NormalExcel.pl
5.73 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
process.pl
6.91 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
process_changed.pl
5.69 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
readwrite.pl
4.16 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxcsv.pl
7.94 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxdb.pl
11.06 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxfile.pl
4.68 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxsalesforce.pl
3.5 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxxml.pl
13.83 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
rxxml2.pl
4.18 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
sendmail.pl
1.06 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
sourcequery.pl
4.18 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
sql.pl
23.98 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
store.pl
7.97 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
tags
13.14 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
task.pl
33.48 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📁
test
-
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
userfunc.pl
5.05 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
valid.pl
3.64 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
workflow.pl
3.94 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
📄
xform.pl
2.62 KB
02/03/2023 07:34:13 AM
rwxr-xr-x
Editing: workflow.pl
Close
#!/usr/bin/perl #executetask($nodeid); sub executewf{ my $wfid = shift; if(not defined $G_Datetime){ $G_Datetime=`date +%Y%m%d`; chomp($G_Datetime); mkdir("$RXXLS_DIR/logs/") or printlog($MAX, "Using $RXXLS_DIR/logs/ as logdir"); } $G_Log_Outfile = "$RXXLS_DIR/logs/".$G_Datetime."_etl.log"; open($DATEWISE_LOG, ">>$G_Log_Outfile"); #Get WorkFlow Deatils my $wfmaster = SQL_wfmaster($wfid); my ($wfname, $wfdesc, $wfstatus) = @$wfmaster; if(!$G_valid){ $G_ParWflowId = $wfid; $G_CurWflowId = $wfid; } statuslog("############################ Workflow Name=$wfname ####################################"); statuslog("Processing Workflow : ID=$wfid\nWforklow Description: $wfdesc"); #Check : Is Workflow Valid? if(!isvalid($wfstatus)){ $G_Err = "Error : Invalid Workflow status for id=$wfid."; printlog($ERROR, $G_Err); etl_dblog('', $G_CurWflowId, $G_ParWflowId, '', time, '', '', '', '', '', '', $G_Err, "$G_logseq"); return; } #Get list of nodes in WorkFlow my $wfnodes = SQL_wfdetails($wfid); # if($G_User >0){ # $ewfnodes= SQL_wfdetails_etluser($wfid); # @$wfnodes=@$ewfnodes; # } printlog($INFO, "Start ..."); foreach my $node(@$wfnodes) { my ($nodeid, $nodetype, $ErrFlag, $taskname, $dtid, $posttaskid) = @$node; statuslog("------------------------------ Task Name=$taskname [$nodetype] ------------------------------"); my $stat = ''; $G_Err = 'DONE'; if($nodetype eq 'W'){ #Workflow statuslog("------------------------------ FOUND CHILD $nodeid ------------------------------"); $G_valid=1; $G_ParWflowId = $nodeid; executewf($nodeid); $G_valid=0; } else{ $G_CurTaskId = $nodeid; my $logid = etl_dblog('', $wfname, $G_ParWflowId, $taskname, time, '', '', '', '', '', '', 'RUN', $G_logseq, $G_CurWflowId, $G_CurTaskId); if($nodetype eq 'T'){ #Task printlog($MAX, "Running task"); $stat = executetask($nodeid); } elsif($nodetype eq 'P'){ #Process Task printlog($MAX, "Executing Process Task"); my $res = SQL_prcsmaster($nodeid); my $cmd = "@$res[0] @$res[4]"; $stat = process_command($cmd); } elsif($nodetype eq 'Q'){ #Query Task my ($dbtype, $database, $host, $user, $pass, $home ) = get_etlparams(); $G_mydestdbconn = opendb("$G_DB", "$user", "$pass"); printlog($MAX, "Executing Query Task"); $stat = execute_sql_query($nodeid, $G_DB); printlog($MAX, "Executing Query Task===========$stat"); $G_Err = $stat; } if($ENV{CUBOT_DBTYPE} eq 'MsSQL'){ $G_Err =~ s/'/''/g; }else{ $G_Err =~ s/'/\\'/g; } statuslog "ETL Message: $G_Err\n"; etl_dblog($logid, '', '', '', '', time, $G_NumRecTotal, $G_NumRecProc, $G_NumRecDisc, $G_NumRecIgnr, '', $G_Err, $G_logseq); $G_NumRecTotal = 0; $G_NumRecProc = 0; $G_NumRecDisc = 0; $G_NumRecIgnr = 0; } statuslog "$ErrFlag eq S $stat ne DONE\n"; if(($ErrFlag eq "S") && ($stat ne "DONE")){ $G_Err = "** Stopped Because Last Task Generated Error and On Error Stop Excution Flag is Set. : $stat **"; printlog($ERROR, $G_Err); statuslog "Now Executing Post Process Task: $posttaskid"; my $res = SQL_prcsmaster($posttaskid); my $cmd = "@$res[0] @$res[4]"; if(@$res[2] eq "W"){ #Bug: 983 $stat = process_workflow(@$res[4]); } else{ $stat = process_command($cmd); } statuslog "Post Process @$res[0] @$res[4] Execution Done: $stat"; last; } } printlog($INFO, "Now Workflow doesn't have any task to execute. Exiting....") if($node eq ''); close($DATEWISE_LOG); } sub test_task{ $G_CurTaskId = $CMD_HARGS{"taskid"}; # $G_CurWflowId = $CMD_HARGS{"logseq"}; # VK-Chg : 02-March $G_CurWflowId = ""; my $logid = etl_dblog('', $G_CurWflowId, $G_ParWflowId, $G_CurTaskId, time, '', '', '', '', '', '', 'TEST', $G_logseq); my $stat = executetask($CMD_HARGS{"taskid"}); #Excute Task in Test Mode; etl_dblog($logid, '', '', '', '', time, $G_NumRecTotal, $G_NumRecProc, $G_NumRecDisc, $G_NumRecIgnr, '', $stat, $G_logseq); } 1;