Archive_HiRISE_Data
Files are moved or copied to their ``archive'' locations based on the filename extension. If table access and field information is provided the field is updated to the file's new pathname. The resulting file is made read-only.
=head1 SYNOPSIS
Archive_HiRISE_Data [-NO-op] [-Quiet] [-Verbose] [-Help] [[-CONfiguration <filename>] [-Table <catalog.table:key=value> [-Field <field name>]] [-COPy] <pathname> [-Force] [...]
Force overwrite of existing file. Use with caution!
Input file(s)
will be copied rather than moved.
The Configuration file used for a database update. This file must contain the necessary database connection information.
Field reference passed to Update_DB for database update. The format is Catalog.Table:Key=Value. This is used to select the record to update. If key is a character type, then value must be quoted and the entire expression must be double quoted, e.g. ``Catalog.Table:Key='Value'''.
The field name in the selected row to update with the archived pathname of the file, defaults to Source_File_Name.
No operations are performed to move/copy the input files or update database entries.
Increase amount of logging messages.
Prints the command usage help.
Each pathname specified is used to generate a destination pathname as the source file's archive location. The destination pathname is:
<HiRISE_ROOT>/Data/<Archive>/<Data_Location>/<filename>
where:
<HiRISE_ROOT> is the value of the HiRISE_ROOT environment variable, or /HiRISE by default.
<Archive> is determined by mapping the extension of the <filename> (the characters after the last '.' in the name) to an archive name:
Extension Archive --------- ------- out HiDog DAT HiDog MDAT HiDog unFELICS HiDog err HiDog IMG EDRgen cub EDR_Stats
<Data_Location> is the result of generating an observation ID from the <filename>, using Make_Observation_ID, and then generating a data location pathname segment from the observation ID, using Data_Location.
<filename> is final filename segment of the specified pathname.
The file at the source pathname will be moved - or copied if the -copy option is specified - to the destination pathname if the following conditions are met: A file must exist at the source pathname. The filename extension must be recognized as mapping to an archive name. An observation ID must be generated from the filename. The observation ID must generate a data location pathname segment. The destination pathname directory must either exist or be created, and be writable.
The destination file will be made readable by user,group,and other, but not writeable.
A database record may be updated after the archive is performed, with the use of the -Table and -Field switches. The argument to the -Table switch is an Update_DB reference of the form Catalog.Table:Key=Value which is a shorthand for ``UPDATE Catalog.Table WHERE Key = Value''.
The field to update with the new pathname is specified with the -Field switch. The default field name is Source_File_Name.
Taken together, these switches can be thought of as shorthand for the statement ``UPDATE Catalog.Table WHERE Key = Value SET Field = new pathname.
A caveat is that if the data type of Key is not numeric (e.g. varchar), the -Table switch must be quoted in addition to the Value, i.e.
-Table ``Catalog.Table:Key='Value'''
The number of files that failed to be processed; i.e. 0 on success. If a command line syntax error occurs the exit status will be 255.
Originally by Ingrid Daubar, UA/HiROC
Changed beyond all recognition by Guy McArthur and Bradford Castalia.
Copyright (C) 2005 Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2.14 $ 2007/07/27 20:04:59