1Rex::Commands::Tail(3)User Contributed Perl DocumentationRex::Commands::Tail(3)
2
3
4
6 Rex::Commands::Tail - Tail a file
7
8 Version <= 1.0: All these functions will not be reported.
9
10 All these functions are not idempotent.
11
13 With this module you can tail a file.
14
16 tail "/var/log/syslog";
17
19 tail($file)
20 This function will tail the given file.
21
22 task "syslog", "server01", sub {
23 tail "/var/log/syslog";
24 };
25
26 If you want to control the output format, you can define a callback
27 function:
28
29 task "syslog", "server01", sub {
30 tail "/var/log/syslog", sub {
31 my ($data) = @_;
32
33 my $server = Rex->get_current_connection()->{'server'};
34
35 print "$server>> $data\n";
36 };
37 };
38
39
40
41perl v5.30.0 2019-07-24 Rex::Commands::Tail(3)