Using && in replication scripts

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using && in replication scripts

Otis Gospodnetic-2
Hi,

I was helping somebody who's getting stuck with temporary indices (index.tmp*) due to some hardware/network error.  I saw the following in snapinstaller:

cp -lr ${name}/ ${data_dir}/index.tmp$$
/bin/rm -rf ${data_dir}/index
mv -f ${data_dir}/index.tmp$$ ${data_dir}/index

Would it be better/safer to do things like the following (in general, not just here) instead?
 
cp -lr ${name}/ ${data_dir}/index.tmp$$ && \
/bin/rm -rf ${data_dir}/index && \
mv -f ${data_dir}/index.tmp$$ ${data_dir}/index



Thanks,
Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch


Reply | Threaded
Open this post in threaded view
|

Re: Using && in replication script

Bill Au
Otis,

The latest snapinstaller already has this change.  Where else do you think
we can use this change also?

Bill

On Feb 6, 2008 4:01 PM, Otis Gospodnetic <[hidden email]> wrote:

> Hi,
>
> I was helping somebody who's getting stuck with temporary indices (
> index.tmp*) due to some hardware/network error.  I saw the following in
> snapinstaller:
>
> cp -lr ${name}/ ${data_dir}/index.tmp$$
> /bin/rm -rf ${data_dir}/index
> mv -f ${data_dir}/index.tmp$$ ${data_dir}/index
>
> Would it be better/safer to do things like the following (in general, not
> just here) instead?
>
> cp -lr ${name}/ ${data_dir}/index.tmp$$ && \
> /bin/rm -rf ${data_dir}/index && \
> mv -f ${data_dir}/index.tmp$$ ${data_dir}/index
>
>
>
> Thanks,
> Otis
> --
> Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch
>
>
>