[
https://issues.apache.org/jira/browse/OODT-306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris A. Mattmann updated OODT-306:
-----------------------------------
Description:
*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 using
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 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 user
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="java
-Dorg.apache.oodt.cas.filemgr.properties=../etc/filemgr.properties
-Djava.ext.dirs=../lib org.apache.oodt.cas.filemgr.tools.QueryTool --url
http://localhost:9000 --lucene -query "
#
alias fmdel="java
-Dorg.apache.oodt.cas.filemgr.properties=../etc/filemgr.properties
-Djava.ext.dirs=../lib org.apache.oodt.cas.filemgr.tools.DeleteProduct
--fileManagerUrl http://localhost:9000 --read"
#
alias metdump="java -Djava.ext.dirs=../lib
org.apache.oodt.cas.filemgr.tools.MetadataDumper --url $FILEMGR_URL --out .
--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 the 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 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 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 the
product's metadata into the current directory. *This one needs a little more
testing and docs.*
Comments are welcome.
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 using
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 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 user
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="java
-Dorg.apache.oodt.cas.filemgr.properties=../etc/filemgr.properties
-Djava.ext.dirs=../lib org.apache.oodt.cas.filemgr.tools.QueryTool --url
http://localhost:9000 --lucene -query "
#
alias fmdel="java
-Dorg.apache.oodt.cas.filemgr.properties=../etc/filemgr.properties
-Djava.ext.dirs=../lib org.apache.oodt.cas.filemgr.tools.DeleteProduct
--fileManagerUrl http://localhost:9000 --read"
#
alias metdump="java -Djava.ext.dirs=../lib
org.apache.oodt.cas.filemgr.tools.MetadataDumper --url $FILEMGR_URL --out .
--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 the 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 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 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 the
product's metadata into the current directory. *This one needs a little more
testing and docs.*
Comments are welcome.
> File Manager Tools for BASH and TCSH
> ------------------------------------
>
> 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
> Fix For: 0.4
>
> Attachments: bash_aliases.txt, tcsh_aliases.txt
>
>
> *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 using
> 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 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 user
> 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="java
> -Dorg.apache.oodt.cas.filemgr.properties=../etc/filemgr.properties
> -Djava.ext.dirs=../lib org.apache.oodt.cas.filemgr.tools.QueryTool --url
> http://localhost:9000 --lucene -query "
> #
> alias fmdel="java
> -Dorg.apache.oodt.cas.filemgr.properties=../etc/filemgr.properties
> -Djava.ext.dirs=../lib org.apache.oodt.cas.filemgr.tools.DeleteProduct
> --fileManagerUrl http://localhost:9000 --read"
> #
> alias metdump="java -Djava.ext.dirs=../lib
> org.apache.oodt.cas.filemgr.tools.MetadataDumper --url $FILEMGR_URL --out .
> --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 the 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 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 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 the
> product's metadata into the current directory. *This one needs a little more
> testing and docs.*
> Comments are welcome.
--
This message was sent by Atlassian JIRA
(v6.2#6252)