sub doXYZ{
...
}
####
#Delete Example
$theCmd="del "."\"".$SourcePath."\" >> ".$LOG_DIR."\\".$F_DUMMY." 2>&1";
$returnCode=system $theCmd;
#Delete Example
$theCmd="copy "."\"".$SourcePath."\\".$SourcePathFileName."\""." "."\"".$DestPath."\\".$DestPahtFileName."\""." >> ".$LOG_DIR."\\".$F_DUMMY." 2>&1";
$returnCode=system $theCmd;
####
while(1==1){
#code here for processing files
sleep(60);
}
####
#FilesToPostgres.txt looks like this:
processedFileName1.csv
processedFielName1.csv
#PostgreSQL then has a scheduler running which reads that file into a table, and then loops its rows and runs subsequent commands like
COPY tableName FROM /path/to/processedFileName1.csv