Rex::Commands::Tail - Tail a file
With this module you can tail a file
tail "/var/log/syslog";
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"; }; };
To install Rex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Rex
CPAN shell
perl -MCPAN -e shell install Rex
For more information on module installation, please visit the detailed CPAN module installation guide.