Changeset 39582
- Timestamp:
- May 27, 2016, 11:05:40 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/tools/cleandsproduct.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/cleandsproduct.pl
r39581 r39582 5 5 use strict; 6 6 7 ## report the program and machine8 use Sys::Hostname;9 my $host = hostname();10 11 7 use vars qw( $VERSION ); 12 8 $VERSION = '0.01'; 13 9 10 use Date::Parse; 11 14 12 use 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 );18 13 use PS::IPP::Metadata::Config; 19 use PS::IPP::Metadata::List qw( parse_md_list );20 21 use Date::Parse;22 23 14 use PS::IPP::Config 1.01 qw( :standard ); 24 15 … … 60 51 ) or pod2usage( 2 ); 61 52 62 pod2usage( -msg => "Unknown option: @ARGV ", -exitval => 2 ) if @ARGV;63 pod2usage( -msg => "Required options: --product ",53 pod2usage( -msg => "Unknown option: @ARGV\n", -exitval => 2 ) if @ARGV; 54 pod2usage( -msg => "Required options: --product\n", 64 55 -exitval => 3) unless 65 56 defined $product; 66 67 57 68 58 if (!$datastore) { … … 73 63 my $uri = "$datastore/$product/index.txt"; 74 64 75 # XXX: I'm not sure why this bracket is here65 # XXX: I'm not sure why this bracket and indentation is here 76 66 { 77 67 my $command = "$dsproductls --uri $uri --extra --timeout 150"; … … 136 126 137 127 __END__ 128 129 =pod 130 =head1 NAME 131 132 cleandsproduct.pl - cleans up a data store product 133 134 =head1 SYNOPSIS 135 136 cleandsproduct.pl --product <product name> [--last-fileset <filesetid>] [--no-rm] [--retention-days <days>] [--use-configured-publish-retention] 137 138 =head1 DESCRIPTION 139 140 Uses 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 141 the filesets from the data store directory and their representation in the database. 142 143 By default, all filesets are deleted. Certain options may be used to stop the cleanup after a given fileset 144 or once all remaining filesets are newer than some time. 145 146 =head1 OPTIONS 147 148 =over 4 149 150 =item --product <product name> 151 152 The name of the product to be cleaned up. 153 154 Required. 155 156 =item --retention-days <days> 157 158 The minimum number of days old for filesets to be cleaned. 159 Optional. 160 161 =item --use-configured-publish-retention 162 163 Get retention-days value from the SiteConfig 164 Optional. 165 166 =item --last_fileset <filesetid> 167 168 The FileSet ID of the last FileSet to be cleaned. Note: if the specified fileset is newer than the retention time 169 cleanup stops after cleaning that fileset. 170 Optional. 171 172 =item --no-rm 173 174 Update the database but do not remove the files on disk. The files will thus still exist, but they will be invisible 175 through the data store interface. 176 177 =head1 Configuration Values 178 179 The following configuration values are used to set certain default values. 180 181 =item DATA_STORE_ROOT_URL 182 183 The http address of the data store. Required. 184 185 =item DATA_STORE_PUBLISH_RETENTION_DAYS 186 187 The number of days that filesets in the publishing data stores should be preserved. Only used and required if 188 the option --use-configured-publish-retention is supplied. 189 190 =back 191 192 =head1 CREDITS 193 194 Bill Sweeney IfA 195 196 =head1 SUPPORT 197 198 Please contact the author directly via e-mail. 199 200 =head1 AUTHOR 201 202 Bill Sweeney bills@ifa.hawaii.edu 203 204 =head1 COPYRIGHT 205 206 Copyright (C) 2011 - 2016 University of Hawaii IfA. 207 208 209 =head1 SEE ALSO 210 211 L<dsreg> L<dsproductls> 212 213 =cut
Note:
See TracChangeset
for help on using the changeset viewer.
