Return-Path: X-Original-To: apmail-oodt-dev-archive@www.apache.org Delivered-To: apmail-oodt-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D52D7704 for ; Sat, 23 Jul 2011 01:58:35 +0000 (UTC) Received: (qmail 26510 invoked by uid 500); 23 Jul 2011 01:58:34 -0000 Delivered-To: apmail-oodt-dev-archive@oodt.apache.org Received: (qmail 26440 invoked by uid 500); 23 Jul 2011 01:58:34 -0000 Mailing-List: contact dev-help@oodt.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@oodt.apache.org Delivered-To: mailing list dev@oodt.apache.org Received: (qmail 26432 invoked by uid 99); 23 Jul 2011 01:58:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Jul 2011 01:58:33 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [128.149.139.105] (HELO mail.jpl.nasa.gov) (128.149.139.105) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Jul 2011 01:58:28 +0000 Received: from mail.jpl.nasa.gov (altvirehtstap02.jpl.nasa.gov [128.149.137.73]) by smtp.jpl.nasa.gov (Switch-3.4.3/Switch-3.4.3) with ESMTP id p6N1w68e022480 (using TLSv1/SSLv3 with cipher RC4-MD5 (128 bits) verified NO) for ; Fri, 22 Jul 2011 18:58:06 -0700 Received: from ALTPHYEMBEVSP20.RES.AD.JPL ([128.149.137.82]) by ALTVIREHTSTAP02.RES.AD.JPL ([128.149.137.73]) with mapi; Fri, 22 Jul 2011 18:58:01 -0700 From: "Mattmann, Chris A (388J)" To: "dev@oodt.apache.org" Date: Fri, 22 Jul 2011 19:01:23 -0700 Subject: Re: [jira] [Updated] (OODT-306) File Manager Tools for BASH and TCSH Thread-Topic: [jira] [Updated] (OODT-306) File Manager Tools for BASH and TCSH Thread-Index: AcxI2/N0jPbGsI9DSiuvFNwVRjqyfg== Message-ID: <05037100-D135-4335-B706-456DFE5F0211@jpl.nasa.gov> References: <1659698710.552.1311382509544.JavaMail.tomcat@hel.zones.apache.org> <1199571419.592.1311382989868.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Source-IP: altvirehtstap02.jpl.nasa.gov [128.149.137.73] X-Source-Sender: chris.a.mattmann@jpl.nasa.gov X-AUTH: Authorized +1 from me... Cheers, Chris On Jul 22, 2011, at 6:43 PM, Cameron Goodale wrote: > So I have been mulling this over since I wrote this JIRA issue and I thin= k I > will break fmquery into: >=20 > lucene_query and sql_query since the query_tool that is being called unde= r > the code is able to query both, and prefixing fm seems a bit redundant. >=20 >=20 > -Cameron >=20 >=20 > On Fri, Jul 22, 2011 at 6:03 PM, Cameron Goodale (JIRA) = wrote: >=20 >>=20 >> [ >> https://issues.apache.org/jira/browse/OODT-306?page=3Dcom.atlassian.jira= .plugin.system.issuetabpanels:all-tabpanel] >>=20 >> Cameron Goodale updated OODT-306: >> --------------------------------- >>=20 >> Description: >> *Chris Mattmann* has been writing some really useful shell alias command= s >> to help with some of the really repetitive tasks that tend to appear whe= n >> using the File Manager component. This issue will be used to share and >> commit 2 files that contain environment settings that can be easily sour= ced, >> or just copied into a users .bashrc or .tcshrc startup file. >>=20 >> The files will contain the scripting commands and some basic documentati= on. >>=20 >> I plan to drop the files into oodt/filemgr/src/main/resources since th= ey >> really only apply to the filemanager. >>=20 >> Here is my initial working Docu-Code (for BASH) I plan to clean up and >> commit. >>=20 >> {code} >> ##### Copy and Paste this Block into the .bashrc of your deployment use= r >> account ########## >> # >> # The following aliases must be used within a filemgr installation's >> # bin directory since relative pathing is being used. This block also >> # assumes that the filemgr is running on port 9000 (the default port of >> filemgr) >> # >> alias fmquery=3D"java >> -Dorg.apache.oodt.cas.filemgr.properties=3D../etc/filemgr.properties >> -Djava.ext.dirs=3D../lib org.apache.oodt.cas.filemgr.tools.QueryTool --u= rl >> http://localhost:9000 --lucene -query " >> # >> alias fmdel=3D"java >> -Dorg.apache.oodt.cas.filemgr.properties=3D../etc/filemgr.properties >> -Djava.ext.dirs=3D../lib org.apache.oodt.cas.filemgr.tools.DeleteProduct >> --fileManagerUrl http://localhost:9000 --read" >> # >> alias metdump=3D"java -Djava.ext.dirs=3D../lib >> org.apache.oodt.cas.filemgr.tools.MetadataDumper --url $FILEMGR_URL --ou= t . >> --productId " >> # >> ######## END OF BLOCK ####### >> {code} >> h2. Previous Commands Explained >>=20 >> h3. fmquery >> This will execute a Lucene Query against the filemanager catalog and ret= urn >> a list of ProductIDs. These Product IDs can then be piped into the fmde= l >> alias to remove all products that match the query criteria. >>=20 >> *Usage:* >> - Return the ProductIds to the terminal window - >> fmquery "ProductType:ISMRawData" >>=20 >> - Pipe the ProductIds to a file - >> fmquery "ProductType:ISMRawData" > ProductID_List.txt >>=20 >>=20 >> h3. fmdel >> Use this command to delete a single product from the catalog. This will >> remove the lucene index entry from the catalog and will remove the archi= ved >> product from disk. (If you just want to see what products will be remov= ed >> from the archive, then you will need to add the --nocommit parameter to = the >> fmdel command alias after the --read param) >>=20 >> *Usage:* >> - Remove one product from the catalog >> fmdel 0691ee17-96ec-11e0-8556-3b3ca12e4f64 >>=20 >> - Remove a set of products from the catalog using the fmquery command >> [fmquery Metadata_Key:"Matching_Key_Value" | fmdel] >> For example: To remove all Products with a GenericFile ProductType us= e >> fmquery ProductType:"GenericFile" | fmdel >>=20 >> h3. metdump >> Just added to the list. This will take in a product_id and dump out the >> product's metadata into the current directory. *This one needs a little >> more testing and docs.* >>=20 >> Comments are welcome. >>=20 >> was: >> Chris Mattmann has been writing some really useful shell alias commands = to >> help with some of the really repetitive tasks that tend to appear when u= sing >> the File Manager component. This issue will be used to share and commit= 2 >> files that contain environment settings that can be easily sourced, or j= ust >> copied into a users .bashrc or .tcshrc startup file. >>=20 >> The files will contain the scripting commands and some basic documentati= on. >>=20 >> I plan to drop the files into oodt/filemgr/src/main/resources since th= ey >> really only apply to the filemanager. >>=20 >> Here is my initial working Docu-Code (for BASH) I plan to clean up and >> commit. >>=20 >>=20 >> ##### Copy and Paste this Block into the .bashrc of your deployment use= r >> account ########## >> # >> # The following aliases must be used within a filemgr installation's >> # bin directory since relative pathing is being used. This block also >> # assumes that the filemgr is running on port 9000 (the default port of >> filemgr) >> # >> alias fmquery=3D"java >> -Dorg.apache.oodt.cas.filemgr.properties=3D../etc/filemgr.properties >> -Djava.ext.dirs=3D../lib org.apache.oodt.cas.filemgr.tools.QueryTool --u= rl >> http://localhost:9000 --lucene -query " >> # >> alias fmdel=3D"java >> -Dorg.apache.oodt.cas.filemgr.properties=3D../etc/filemgr.properties >> -Djava.ext.dirs=3D../lib org.apache.oodt.cas.filemgr.tools.DeleteProduct >> --fileManagerUrl http://localhost:9000 --read" >> # >> alias metdump=3D"java -Djava.ext.dirs=3D../lib >> org.apache.oodt.cas.filemgr.tools.MetadataDumper --url $FILEMGR_URL - >> -out . --productId " >> # >> ######## END OF BLOCK ####### >> Previous Commands Explained >>=20 >> fmquery - This will execute a Lucene Query against the filemanager catal= og >> and return a list of ProductIDs. These Product IDs can then be piped in= to >> the fmdel alias to remove all products that match the query criteria. >>=20 >> Usage: >> - Return the ProductIds to the terminal window - >> fmquery "ProductType:ISMRawData" >>=20 >> - Pipe the ProductIds to a file - >> fmquery "ProductType:ISMRawData" > ProductID_List.txt >>=20 >>=20 >> fmdel - Use this command to delete a single product from the catalog. T= his >> will remove the lucene index entry from the catalog and will remove the >> archived product from disk. (If you just want to see what products will= be >> removed from the archive, then you will need to add the --nocommit param= eter >> to the fmdel command alias after the --read param) >>=20 >> Usage: >> - Remove one product from the catalog >> fmdel 0691ee17-96ec-11e0-8556-3b3ca12e4f64 >>=20 >> - Remove a set of products from the catalog using the fmquery command >> [fmquery Metadata_Key:"Matching_Key_Value" | fmdel] >> For example: To remove all Products with a GenericFile ProductType us= e >> fmquery ProductType:"GenericFile" | fmdel >>=20 >> metdump - Just added to the list. This will take in a product_id and du= mp >> out the product's metadata into the current directory. This one needs a >> little more testing and docs. >>=20 >> Comments are welcome. >>=20 >>=20 >> Cleaned up the formatting and wrapped the example in a proper code block >>=20 >>> File Manager Tools for BASH and TCSH >>> ------------------------------------ >>>=20 >>> Key: OODT-306 >>> URL: https://issues.apache.org/jira/browse/OODT-306 >>> Project: OODT >>> Issue Type: Task >>> Components: file manager >>> Environment: *nix OS >>> Reporter: Cameron Goodale >>> Assignee: Cameron Goodale >>> Priority: Trivial >>>=20 >>> *Chris Mattmann* has been writing some really useful shell alias comman= ds >> to help with some of the really repetitive tasks that tend to appear whe= n >> using the File Manager component. This issue will be used to share and >> commit 2 files that contain environment settings that can be easily sour= ced, >> or just copied into a users .bashrc or .tcshrc startup file. >>> The files will contain the scripting commands and some basic >> documentation. >>> I plan to drop the files into oodt/filemgr/src/main/resources since >> they really only apply to the filemanager. >>> Here is my initial working Docu-Code (for BASH) I plan to clean up and >> commit. >>> {code} >>> ##### Copy and Paste this Block into the .bashrc of your deployment us= er >> account ########## >>> # >>> # The following aliases must be used within a filemgr installation's >>> # bin directory since relative pathing is being used. This block also >>> # assumes that the filemgr is running on port 9000 (the default port of >> filemgr) >>> # >>> alias fmquery=3D"java >> -Dorg.apache.oodt.cas.filemgr.properties=3D../etc/filemgr.properties >> -Djava.ext.dirs=3D../lib org.apache.oodt.cas.filemgr.tools.QueryTool --u= rl >> http://localhost:9000 --lucene -query " >>> # >>> alias fmdel=3D"java >> -Dorg.apache.oodt.cas.filemgr.properties=3D../etc/filemgr.properties >> -Djava.ext.dirs=3D../lib org.apache.oodt.cas.filemgr.tools.DeleteProduct >> --fileManagerUrl http://localhost:9000 --read" >>> # >>> alias metdump=3D"java -Djava.ext.dirs=3D../lib >> org.apache.oodt.cas.filemgr.tools.MetadataDumper --url $FILEMGR_URL --ou= t . >> --productId " >>> # >>> ######## END OF BLOCK ####### >>> {code} >>> h2. Previous Commands Explained >>> h3. fmquery >>> This will execute a Lucene Query against the filemanager catalog and >> return a list of ProductIDs. These Product IDs can then be piped into t= he >> fmdel alias to remove all products that match the query criteria. >>> *Usage:* >>> - Return the ProductIds to the terminal window - >>> fmquery "ProductType:ISMRawData" >>> - Pipe the ProductIds to a file - >>> fmquery "ProductType:ISMRawData" > ProductID_List.txt >>> h3. fmdel >>> Use this command to delete a single product from the catalog. This wil= l >> remove the lucene index entry from the catalog and will remove the archi= ved >> product from disk. (If you just want to see what products will be remov= ed >> from the archive, then you will need to add the --nocommit parameter to = the >> fmdel command alias after the --read param) >>> *Usage:* >>> - Remove one product from the catalog >>> fmdel 0691ee17-96ec-11e0-8556-3b3ca12e4f64 >>> - Remove a set of products from the catalog using the fmquery command >>> [fmquery Metadata_Key:"Matching_Key_Value" | fmdel] >>> For example: To remove all Products with a GenericFile ProductType >> use >>> fmquery ProductType:"GenericFile" | fmdel >>> h3. metdump >>> Just added to the list. This will take in a product_id and dump out th= e >> product's metadata into the current directory. *This one needs a little >> more testing and docs.* >>> Comments are welcome. >>=20 >> -- >> This message is automatically generated by JIRA. >> For more information on JIRA, see: http://www.atlassian.com/software/jir= a >>=20 >>=20 >>=20 >=20 >=20 > -- >=20 > Sent from a Tin Can attached to a String ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Chris Mattmann, Ph.D. Senior Computer Scientist NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA Office: 171-266B, Mailstop: 171-246 Email: chris.a.mattmann@nasa.gov WWW: http://sunset.usc.edu/~mattmann/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Adjunct Assistant Professor, Computer Science Department University of Southern California, Los Angeles, CA 90089 USA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++