OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
bin
/
etl
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/03/2023 08:06:37 AM
rwxr-xr-x
📄
config.pl
6.53 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
dataextract.sh
2.51 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
etl.pl
5.46 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
etlproc
11.81 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
func.pl
4.01 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
globvar.sh
330 bytes
02/03/2023 07:34:08 AM
rw-r--r--
📄
initetl.pl
1.88 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
libawk.awk
3.07 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
makeXtab2NormalExcel.pl
5.25 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
process.pl
6.92 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
process_changed.pl
5.69 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
readwrite.pl
4.16 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
rxcsv.pl
7.94 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
rxdb.pl
8.84 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
rxfile.pl
4.72 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
rxsalesforce.pl
3.33 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
rxsalesforce.pl.bak
3.33 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
rxxml.pl
12.66 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
rxxml2.pl
4.18 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
s.log
8.86 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
sendmail.pl
1.06 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
sourcequery.pl
4.17 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
sql.pl
13.89 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
sql_mssql.pl
13.89 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
store.pl
7.6 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
task.pl
30.55 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
task_mssql.pl
30.8 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
tmpxml.pl
1.49 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
userfunc.pl
5.5 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
valid.pl
3.9 KB
02/03/2023 07:34:08 AM
rw-r--r--
📄
workflow.pl
3.72 KB
02/03/2023 07:34:08 AM
rwxr-xr-x
📄
xform.pl
2.62 KB
02/03/2023 07:34:08 AM
rw-r--r--
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) = @$col_values;#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, 0, 0, 0, 0, 0, 0, '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 printlog($MAX, "Executing Query Task"); $stat = execute_sql_query($nodeid, $G_DB); printlog($MAX, "Executing Query Task===========$stat"); } $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;