IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39582 for trunk/tools


Ignore:
Timestamp:
May 27, 2016, 11:05:40 AM (10 years ago)
Author:
bills
Message:

Add pod documentation and delete some unnecessary imports and code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/cleandsproduct.pl

    r39581 r39582  
    55use strict;
    66
    7 ## report the program and machine
    8 use Sys::Hostname;
    9 my $host = hostname();
    10 
    117use vars qw( $VERSION );
    128$VERSION = '0.01';
    139
     10use Date::Parse;
     11
    1412use IPC::Cmd 0.36 qw( can_run run );
    15 use File::Temp qw( tempfile );
    16 use File::Basename qw( basename );
    17 use Digest::MD5::File qw( file_md5_hex );
    1813use PS::IPP::Metadata::Config;
    19 use PS::IPP::Metadata::List qw( parse_md_list );
    20 
    21 use Date::Parse;
    22 
    2314use PS::IPP::Config 1.01 qw( :standard );
    2415
     
    6051           ) or pod2usage( 2 );
    6152
    62 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    63 pod2usage( -msg => "Required options: --product",
     53pod2usage( -msg => "Unknown option: @ARGV\n", -exitval => 2 ) if @ARGV;
     54pod2usage( -msg => "Required options: --product\n",
    6455           -exitval => 3) unless
    6556    defined $product;
    66 
    6757
    6858if (!$datastore) {
     
    7363my $uri = "$datastore/$product/index.txt";
    7464
    75 # XXX: I'm not sure why this bracket is here
     65# XXX: I'm not sure why this bracket and indentation is here
    7666{
    7767    my $command = "$dsproductls --uri $uri --extra --timeout 150";
     
    136126
    137127__END__
     128
     129=pod
     130=head1 NAME
     131
     132cleandsproduct.pl - cleans up a data store product
     133
     134=head1 SYNOPSIS
     135
     136cleandsproduct.pl --product <product name> [--last-fileset <filesetid>] [--no-rm] [--retention-days <days>] [--use-configured-publish-retention]
     137
     138=head1 DESCRIPTION
     139
     140Uses L<dsproductls> to get a listing of all of the filesets in a data store product, then the program L<dsreg> is used to delete
     141the filesets from the data store directory and their representation in the database.
     142
     143By default, all filesets are deleted. Certain options may be used to stop the cleanup after a given fileset
     144or once all remaining filesets are newer than some time.
     145
     146=head1 OPTIONS
     147
     148=over 4
     149
     150=item --product <product name>
     151
     152The name of the product to be cleaned up.
     153
     154Required.
     155
     156=item --retention-days <days>
     157
     158The minimum number of days old for filesets to be cleaned.
     159Optional.
     160
     161=item --use-configured-publish-retention
     162
     163Get retention-days value from the SiteConfig
     164Optional.
     165
     166=item --last_fileset <filesetid>
     167
     168The FileSet ID of the last FileSet to be cleaned. Note: if the specified fileset is newer than the retention time
     169cleanup stops after cleaning that fileset.
     170Optional.
     171
     172=item --no-rm
     173
     174Update the database but do not remove the files on disk. The files will thus still exist, but they will be invisible
     175through the data store interface.
     176
     177=head1 Configuration Values
     178
     179The following configuration values are used to set certain default values.
     180
     181=item DATA_STORE_ROOT_URL
     182
     183The http address of the data store. Required.
     184
     185=item DATA_STORE_PUBLISH_RETENTION_DAYS
     186
     187The number of days that filesets in the publishing data stores should be preserved. Only used and required if
     188the option --use-configured-publish-retention is supplied.
     189
     190=back
     191
     192=head1 CREDITS
     193
     194Bill Sweeney IfA
     195
     196=head1 SUPPORT
     197
     198Please contact the author directly via e-mail.
     199
     200=head1 AUTHOR
     201
     202Bill Sweeney bills@ifa.hawaii.edu
     203
     204=head1 COPYRIGHT
     205
     206Copyright (C) 2011 - 2016  University of Hawaii IfA.
     207
     208
     209=head1 SEE ALSO
     210
     211L<dsreg> L<dsproductls>
     212
     213=cut
Note: See TracChangeset for help on using the changeset viewer.