The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
error message lo-lp-kl Linux 1 05-14-2008 08:04 AM
Error Message RDM00 UNIX for Dummies Questions & Answers 2 10-06-2006 06:43 PM
Error message ghuber UNIX for Advanced & Expert Users 1 11-14-2005 06:04 AM
Error message ghuber SUN Solaris 0 11-13-2005 04:20 PM
error message vnc Castelior UNIX for Advanced & Expert Users 3 10-21-2004 04:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-11-2008
geeyess123 geeyess123 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 1
Error Message while copying- Pls Help

Hi I have the following script for performing regression testing of two setups ...

if [ $# -eq 0 ] ; then
echo "Usage Check CfgFile"
exit
fi
cfgfile=$1
cfgdir="/prod/quic/data/product/tools/cfg"
testdir="/prod/quic/data/product/tools/test"
scripts="/prod/quic/data/product/tools/scripts"
cd $cfgdir
ll $cfgfile >/dev/null 2>/dev/null
if [ $? -eq 2 ] ; then
echo "CfgFile not found"
exit
fi
filetype=`cut -f1 -d"," ${cfgfile}`
filepattern=`cut -f2 -d"," ${cfgfile}`
lscript=`cut -f3 -d"," ${cfgfile}`
rscript=`cut -f4 -d"," ${cfgfile}`
filedir=`cut -f5 -d"," ${cfgfile}`
lindir=`cut -f6 -d"," ${cfgfile}`
rindir=`cut -f7 -d"," ${cfgfile}`
llog=`cut -f8 -d"," ${cfgfile}`
rlog=`cut -f9 -d"," ${cfgfile}`
loutdir=`cut -f10 -d"," ${cfgfile}`
routdir=`cut -f11 -d"," ${cfgfile}`
outpattern=`cut -f12 -d"," ${cfgfile}`
testdirloc=`cut -f13 -d"," ${cfgfile}`
testdirrem=`cut -f14 -d"," ${cfgfile}`
cd -
rcp $llog crpop@hppa3:$rlog
cd $filedir
ls -1 *$filepattern > "$filetype".tmp
cd /prod/quic/bin
/prod/quic/bin/wrapper_xml.pl /prod/quic/cfg/preproc_dms300.xml&
/prod/quic/bin/wrapper_xml.pl /prod/quic/cfg/formatter_dms300.xml&
remsh hppa3 -l crpop "cd /prod/tools/ItaReg;$rscript"&
cd $filedir
cat $filetype.tmp | while read line
do #loop1
echo "Started processing $line"
cd $filedir
cp $line $lindir
#cp $line ${line%$filepattern}p${filepattern}
#rcp ${line%$filepattern}p${filepattern} crpop@hppa3:$rindir
#rm ${line%$filepattern}p${filepattern}
rcp $line crpop@hppa3:$rindir
#mv $line $line.done
cd $loutdir
chk=0
while [ ${chk} -eq 0 ]
do #loop2
sleep 2
chk=`ls ${line%$filepattern}*$outpattern 2>&- | wc -l`
done #loop2 end
chk=0
while [ ${chk} -eq 0 ]
do #loop3
sleep 2
chk=`remsh hppa3 -l crpop -n "cd $routdir;ls ${line%$filepattern}*$outpattern" 2>&-|wc -l`
done #loop3 end
echo "Finished processing $line"
cd $filedir
done #loop1 end
cd $loutdir
cp -p *${outpattern} $testdirloc
rcp -p crpop@hppa3:${routdir}/*${outpattern} $testdirrem
cd $testdirloc
#for file in ${outpattern}
#do
# mv $file ${file%.lnp}
#done
#uncompress *.Z
cd ..
ls -1 $testdirloc/*${outpattern} > "$filetype".loc.tmp
cd $testdirrem
#for file in ${outpattern}
#do
# mv $file ${file%.lnp}
#done
#uncompress *.Z
cd ..
ls -1 $testdirrem/*${outpattern} > "$filetype".rem.tmp

echo " Completed processing files"
diff $testdirloc $testdirrem | grep "diff" > "$filetype".diff
echo "DONE"

I have the script and input files in one machine hp961 . There are two seperate setups. One in hppa2 and another in hp961.

I have to proces files in both and compare them. ( well thats obvious)

I cannot place all my file sin the input together since the sequence in which they are processed shud be thesame. So i have used a loop to place the files in the respective inputs ( local and remote) one by one.

The problem I am facing is that when I place files and run the script I get the following error sometimes. But at other times the files are processed fine .


cp: cannot set the permission bits on product/dms300/preproc/input/67/U080823050069OCC: No such file or directory

Can someone please help me out.

Also I start numerous background processes in both machines (local and remote). I need all those processes to terminate once the script has finished running. Is there anyway?
  #2 (permalink)  
Old 08-11-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,272
I am blind now... There are [ code ] and [ /code ] tags to help display code properly.

Quote:
cp: cannot set the permission bits on product/dms300/preproc/input/67/U080823050069OCC: No such file or directory
You should echo your variables and check if the paths etc. are correct, for example those two for your copy here:
Code:
cp $line $lindir
Also I recommend to use scp instead of rcp.

For the start of background processes from one machine, you could use ssh or rsh, better ssh
Also for killing them at once, you might use ssh again and something like:
Code:
ps -ef| grep myscript| awk 'NR > 1 {print $2}' | xargs kill
Make sure you only get the processes you want, ie. leave the xargs out for a moment and check it.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0