Jan Gehring > Rex-0.44.6.1 > Rex::Commands::Tail

Download:
Rex-0.44.6.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Source   Latest Release: Rex-0.55.3

NAME ^

Rex::Commands::Tail - Tail a file

DESCRIPTION ^

With this module you can tail a file

SYNOPSIS ^

 tail "/var/log/syslog";

EXPORTED FUNCTIONS ^

tail($file)

This function will tail the given file.

 task "syslog", "server01", sub {
    tail "/var/log/syslog";
 };

Or, if you want to format the output by yourself, you can define a callback function.

 task "syslog", "server01", sub {
    tail "/var/log/syslog", sub {
      my ($data) = @_;
      
      my $server = Rex->get_current_connection()->{'server'};
      
      print "$server>> $data\n";
    };
 };
syntax highlighting: