Permalink
Browse files

documented the new SSH_BATCH_RC environment for specifying a differen…

…t rc config file name than the default ~/.fornodesrc.
  • Loading branch information...
1 parent 002b60f commit 21809eee7746fec04c335aca3faea4db22b78a82 @agentzh committed Aug 25, 2011
Showing with 10 additions and 2 deletions.
  1. +7 −1 lib/SSH/Batch.pm
  2. +3 −1 lib/SSH/Batch/ForNodes.pm
View
@@ -99,7 +99,7 @@ System administration (sysadmin) is also part of my C<$work>. Playing with a (bi
This is a high-level abstraction over the powerful L<Net::OpenSSH> module. A bunch of handy scripts are provided to simplify big cluster operations: L<fornodes>, L<atnodes>, L<tonodes>, and L<key2nodes>.
-C<SSH::Batch> allows you to name your clusters using variables and interval/set syntax in your F<~/.fornodesrc> config file. For instance:
+C<SSH::Batch> allows you to name your clusters using variables and interval/set syntax in your F<~/.fornodesrc> config file (or a different file name specified by the C<SSH_BATCH_RC> environment). For instance:
$ cat ~/.fornodesrc
A=foo[01-03].com bar.org
@@ -250,6 +250,12 @@ You may have already learned that you can use the C<-u> and C<-p> options to spe
$ atnodes 'ls -lh' '{B} + bob@bar[29-31].org:5678'
+It's also possible to specify a different rc config file than F<~/.fornodesrc> via the environment variable C<SSH_BATCH_RC>. For example,
+
+ export SSH_BATCH_RC=/opt/my-fornodes-rc
+
+then the file F</opt/my-fornodes-rc> will be used instead of the default F<~/.fornodesrc> file.
+
=item Use C<-L> to help grepping the outputs by hostname
When managing hundreds or even thousands of machines, it's often more
@@ -289,6 +289,8 @@ SSH::Batch::ForNodes - Expand set arithmetic expression to host list
use SSH::Batch::ForNodes;
SSH::Batch::ForNodes::init_rc();
+ # read the config file from env SSH_BATCH_RC or directly ~/.fornodesrc
+
my $set = SSH::Batch::ForNodes::parse_expr($expr);
# set is a Set::Scalar instance:
for my $host (sort $set->elements) {
@@ -309,7 +311,7 @@ Liseen Wan (万珣新) C<< <liseen.wan@gmail.com> >>
=back
-=head1 COPYRIGHT AND LICENSE
+=head1 COPYRIGHT & LICENSE
This module as well as its programs are licensed under the BSD License.

0 comments on commit 21809ee

Please sign in to comment.