Use proper POD for syncToCdn.pl's docs. Fixes bug #11100

This commit is contained in:
Colin Kuskie 2009-10-06 15:20:16 -07:00
parent 0e94d42034
commit ca7a285ace
2 changed files with 93 additions and 9 deletions

View file

@ -42,6 +42,7 @@
- fixed #11088: i18n Survey Section Information - fixed #11088: i18n Survey Section Information
- fixed #11087: SC asset repeats its own description in feeds - fixed #11087: SC asset repeats its own description in feeds
- fixed #10916: png icon - fixed #10916: png icon
- fixed #11100: syncToCdn's help is not proper POD
7.8.0 7.8.0
- upgraded YUI to 2.8.0r4 - upgraded YUI to 2.8.0r4

View file

@ -20,6 +20,7 @@ use Fcntl ':flock';
use Getopt::Long; use Getopt::Long;
use WebGUI::Session; use WebGUI::Session;
use WebGUI::Storage; use WebGUI::Storage;
use Pod::Usage;
my $configFile; my $configFile;
my $help; my $help;
@ -32,17 +33,11 @@ GetOptions(
'override' => \$override, 'override' => \$override,
'migrate' => \$migrate, 'migrate' => \$migrate,
'quiet' => \$quiet, 'quiet' => \$quiet,
'h|help' => \$help,
); );
if ( $configFile eq "" ) { pod2usage( { verbose => 2, exitval => 2, } ) if $help;
printHelp(); pod2usage( { exitval => 4, } ) unless $configFile;
exit 4;
}
if ($help) {
printHelp();
exit 2;
}
# don't want two copies of this to run simultaneously # don't want two copies of this to run simultaneously
unless ( flock( DATA, LOCK_EX | LOCK_NB ) ) { unless ( flock( DATA, LOCK_EX | LOCK_NB ) ) {
@ -213,3 +208,91 @@ sub syncUploads {
__DATA__ __DATA__
This exists so flock() code above works. This exists so flock() code above works.
DO NOT REMOVE THIS DATA SECTION. DO NOT REMOVE THIS DATA SECTION.
__END__
=head1 NAME
syncToCdn - WebGUI interface to a Content Delivery Network.
=head1 SYNOPSIS
syncToCdn.pl --configFile config.conf
[--override]
[--migrate]
[--quiet]
syncToCdn.pl --help
=head1 DESCRIPTION
This WebGUI utility script displays the amount of disk space used by
an asset and it's descendants. It has been modeled after the *nix 'du'
utility.
=over
=item B<--configFile config.conf>
The WebGUI config file to use. Only the file name needs to be specified,
since it will be looked up inside WebGUI's configuration directory.
This parameter is required.
=item B<--override>
This utility is designed to be run as a privileged user on Linux style
systems. If you wish to run this utility without being the super user,
then use this flag, but note that it may not work as intended.
=item B<--migrate>
Migrate entirety of uploads directory to CDN. Ignore the CDN queue and
sync everything.
=item B<--quiet>
Disable output unless there is an error.
=item B<--help>
Shows this documentation, then exits.
=back
=head1 EXIT CODES
The following exit values are returned:
=over 4
=item 0
Successful execution.
=item 1
Only super user may run the script.
=item 2
Help requested.
=item 3
Only one instance of this script can run at a time.
=item 4
Error during invocation of the command.
=item 5
Content Delivery Network (CDN) is not enabled.
=back
=head1 AUTHOR
Copyright 2001-2009 Plain Black Corporation.
=cut