[SATLUG] small script, baffled problem.

Richard Suberg rsuberg at satx.rr.com
Wed Aug 11 16:26:57 CDT 2010


I can't find anything anywhere that helps me out with this one.  I have a
simple script that mounts by ftp and then copies data from that server to
mine. Problem is if the mount fails (other server changes password or just
connect fails) it wipes out the destination and doesn't tell me anything. I
decided to add an if clause after the mount, and after that on failures I
get either syntax error near unexpected token '}' or near unexpected token
'fi' or near unexpected token 'else'.  I even run into unexpected end of
file, just depends on what is at the end of the file.  I would like to have
an error-processing routine that would let me know somehow that it failed,
but if it just skips the copy on mount failed that would be better than
nothing.

 

I'm totally baffled, and just see how many hits you get trying to search for
if then else ubuntu.even tried what I found there, (using brackets, fi, .)
and no help. Hopefully someone can see the problem easily. 

 

- - - - -

curlftpfs 205.145.4.35 /remote -o allow_other,user=user:pass  -v

echo exit=$?

if  $?=0   then 

 echo Processing...

 date

 cp -uRv /remote/* /share/DSD/ 

 chmod -R 777 /share

 umount /remote

 echo done

 exit 0 

fi

 

 



More information about the SATLUG mailing list