Return-Path: Delivered-To: apmail-lucene-solr-user-archive@locus.apache.org Received: (qmail 75126 invoked from network); 20 Jun 2007 14:23:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jun 2007 14:23:54 -0000 Received: (qmail 17394 invoked by uid 500); 20 Jun 2007 14:23:55 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 17368 invoked by uid 500); 20 Jun 2007 14:23:54 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 17355 invoked by uid 99); 20 Jun 2007 14:23:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jun 2007 07:23:54 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [206.190.38.243] (HELO web50310.mail.re2.yahoo.com) (206.190.38.243) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 20 Jun 2007 07:23:50 -0700 Received: (qmail 12488 invoked by uid 60001); 20 Jun 2007 14:23:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=oaKQJ84kQlcg3v9+c1rikHrMxtUWO5u+UkkNpWZJKjuEeYMY/c9cJsRr9T3YmwwSAVyBE/zJVw8DapuAsI+k1xJ8XVzfE7Kp+x1tA5hZzGolrkMaudHZ3XAK+FsOpzRMx9rB98Ii7TYjLlWxk3jSDISepJ1pgAy8BTuUtAcA0+I=; X-YMail-OSG: w7GL5bEVM1lVMdHLzt4dwEmdflNq1dFRaApqsl8woTFhUhfZL9o5D68VCcgKM3KCxW7hwGJRJQ-- Received: from [216.252.108.190] by web50310.mail.re2.yahoo.com via HTTP; Wed, 20 Jun 2007 07:23:29 PDT X-Mailer: YahooMailRC/651.29 YahooMailWebService/0.7.41.16 Date: Wed, 20 Jun 2007 07:23:28 -0700 (PDT) From: Otis Gospodnetic Subject: snapinstaller safety To: solr-user@lucene.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Message-ID: <206122.11396.qm@web50310.mail.re2.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, Looking at src/scripts/snapinstaller more closely, I saw this block of code: # install using hard links into temporary directory # remove original index and then atomically copy new one into place logMessage installing snapshot ${name} cp -lr ${name}/ ${data_dir}/index.tmp$$ /bin/rm -rf ${data_dir}/index mv -f ${data_dir}/index.tmp$$ ${data_dir}/index Is there a technical reason why this wasn't written as: logMessage installing snapshot ${name} cp -lr ${name}/ ${data_dir}/index.tmp$$ && \ /bin/rm -rf ${data_dir}/index && \ mv -f ${data_dir}/index.tmp$$ ${data_dir}/index This feels a little safer to me - I'd hate to have the main index rm -rf-ed if the cp -lr command failed for some reason (e.g. disk full), but maybe Bill Au & Co. have a good reason for not using &&'s. There may be other places in various scripts that this might be applicable to, but this is the first place I saw the extra safety possibility. Thanks, Otis