We had to install jetforms in an AIX machine, for development purposes, but didn’t have a license…
Figuring out it receives jobs and outputs pdfs in directories, well, we can just copy the jobs to a remote server
and retrieve the pdfs too.
The forms should also be placed somewhere to be replicated.
So we installed jetforms in a remote solaris machine, and wrote some daemon scripts in the AIX, to do the
job, form and result transfer.
The core of it all is /scripts/jf.ksh, a set of 3 daemons written in one script:
# cat /scripts/jf.ksh
#!/bin/ksh
echo “`date` starting…”
(while true;do
(for file in /usr/local/adobe/central/server/data/*.dat;do
echo “`date`: COPYING: $file TO REMOTE”
273/433
rcp $file wasdesa2:/usr/local/adobe/central/server/data
rm $file
done) >/dev/null 2>&1
sleep 4;
done ) &
(while true;do
(for file in `find /usr/local/adobe/central/server/etc/exprint/forms -type f -mtime -1`;do
echo “`date`: COPYING: $file TO REMOTE”
rcp $file wasdesa2:/usr/local/adobe/central/server/etc/exprint/forms
done) >/dev/null 2>&1
sleep 15;
done ) &
(while true;do
for file in `rsh wasdesa2 “find /usr/local/adobe/central/server/data -type f -mtime -100| grep -i pdf”`;do
if [ ! -f $file ];then
echo “`date`: COPYING: $file FROM REMOTE”
rcp wasdesa2:$file /usr/local/adobe/central/server/data
fi
done
sleep 4;
done ) &
The enclosed parentheses do the forking magic. We are using /.rhosts loose security for this, maybe we’ll use
keys on ssh later.
To keep the party going on and on, we wrote a “start” script
# cat /scripts/jetstart.ksh
#!/bin/ksh
P=`ps -ef | grep jf.ksh|grep -iv grep|wc -l`
if [ $P -eq 0 ];then
echo “jf is not running, starting..”
/scripts/jf.ksh > /scripts/jf.log &
echo “started”
fi
We also wrote a “stop” script:
# cat /scripts/jetstart.ksh
#!/bin/ksh
P=`ps -ef | grep jf.ksh|grep -iv grep|wc -l`
if [ $P -eq 0 ];then
echo “jf is not running, starting..”
/scripts/jf.ksh > /scripts/jf.log &
echo “started”
fi
And added a cron entry to keep it goin’
0,5,10,15,20,25,30,35,40,45,50,55
/scripts/jetstart.ksh > /dev/null 2>&1