#!/usr/bin/perl

use strict;
use warnings;
use 5.010;
use Yars::Command::yars_balance;

Yars::Command::yars_balance->main(@ARGV);

__END__

=pod

=encoding UTF-8

=head1 NAME

yars_balance - Fix all files

=head1 VERSION

version 1.33

=head1 SYNOPSIS

 % yars_balance

=head1 DESCRIPTION

Rebalance files in the yars cluster so that all stashed files are returned
to the correct server.  This was originally done using the L<yars_fast_balance>
command, which is buggy and not as fast as this one.

=head1 OPTIONS

=head2 --threads | -t

The number of threads to run in parallel.  Only one thread per disk will execute
at a  time.

=head2 --backup | -b

After copying files to the correct bucket (either as a local file copy, or as
a Yars file transfer), rename the original file to a backup directory, instead of
unlinking it.  This is particularly useful when adding new untested disks to
a yars cluster.

=head2 --delay | -d

Delay deletes or renames to avoid race conditions with GETs.  Note that this
introduces a race condition with DELETEs.

=head2 --load | -l number

Pause balance when load average exceeds I<number>.  Only implemented on systems
that provide C</proc/loadavg>, such as Linux.

=head1 AUTHOR

Original author: Marty Brandon

Current maintainer: Graham Ollis E<lt>plicease@cpan.orgE<gt>

Contributors:

Brian Duggan

Curt Tilmes

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by NASA GSFC.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut
