Perl Script Help!
First off I am new to coding Perl so I need some help.
Previously we ran a .bat file that called a .vbs script (I'll add the script) to move groupmaker .xml files to the luminis server and then ran a
bash -i cptool import segment d:\sct\GroupMakerImports\import_Grpmkr.xml -r >D:\Scriptlogs\GP_make_imp_log.txt
This ran as scheduled tasks any time a group was added to a shared folder. Both the shared folder and Luminis were on Windows boxes.
Now we upgraded to LumIV. We also changed the platform that luminis sits on to Solaris 10. Now I am not able to use my vbscript and .bat file to automatically move and import these files.
I would like to use Perl to accomplish this since it can work cross platform. I am not sure where to start and was hoping someone else might have a perl script doing something similar or at least a start.
Before any mention it I was going to write a script to ftp the file. The problem we have, I still want to use the functionality of the rename and remove function in the .vbs script.
Anyone able to help I would truely appreciate it!!! Much thanks in advance!!
Scott Moore
Senior Systems Analyst
Black Hawk College
moores@bhc.edu

perl help...via bash:)
Someone might post a perl method, but I use bash on solaris to import segments like so:
The script has an list of segment files in the top. It loops through that list/array writing the text "import segment -r filename.xml" to a file.
Before the cmd file is written to though, I start cptool in shell mode using the -f option, so that cptool is running, waiting for a command file to give it orders.
The script also does a scp to get the files from our banner server, so you can cut that out if your files are already present on your luminis server.
I see it lost some formatting when I posted it. If it won't run, let me know and I can email you a formatted copy if you want.
-bash-3.00$ more main.sh
#!/bin/bash
. /mnt/portal/.cprc
rundate=`date +%y-%m-%d`; export rundate
segment[1]="ALL_EM_BENEFITS_iwrsegm.xml"
segment[2]="EL_ST_REGS_CURR_iwrsegm.xml"
segment[3]="SY_EM_CURRENT_iwrsegm.xml"
segment[4]="CA_EM_CURRENT_iwrsegm.xml"
segment[5]="RC_EM_CURRENT_iwrsegm.xml"
segment[6]="SY_ST_REGS_CURR_iwrsegm.xml"
segment[7]="CA_ST_REGS_CURR_iwrsegm.xml"
segment[8]="RC_ST_REGS_CURR_iwrsegm.xml"
i=1; export i
j=1; export j
appdir=/export/home/luma/scripts/segments
datadir=$appdir/data
cmdfile=$appdir/cmdfile.cmd
cp /dev/null $cmdfile
echo "Starting Cptool shell in the background"
cptool start shell -f=$cmdfile > cptool.log 2>&1 &
echo "Entering loop to import files"
while [[ $i -le ${#segment[*]} ]];do
echo "getting file ${segment[i]} via scp"
scp segmentacct@segmentserver.pcc.edu:${segment[i]} $datadir
i=$(( $i + 1 ))
done
echo "Entering loop to write command file"
while [[ $j -le ${#segment[*]} ]];do
echo "writing to command file: importing segment ${segment[j]}"
echo "import segment -r" $datadir/${segment[j]} >> $cmdfile
j=$(( $j + 1 ))
done
echo "quit" >> $cmdfile
mailx -s "segment script" admin@pcc.edu < /export/home/luma/scripts/segments/segments.log