The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

tailswitch - Tail a file, but switch when another file with newer name appears

VERSION

This document describes version 0.001 of tailswitch (from Perl distribution App-tailswitch), released on 2017-06-09.

SYNOPSIS

 % tailswitch [OPTIONS] <GLOB PATTERN> ...

Don't forget to quote the glob pattern to prevent shell expansion. Example:

 % tailswitch '/var/log/http_access.*.log' '/var/log/https_access.*.log'

DESCRIPTION

This utility can tail a file, but switch when another file with newer name appears. This utility is useful when tailing log that are written to separated files (usually with timestamps in their names). For example, on an Spanel server, the webserver is configured to write to daily log files:

 /s/<SITE-NAME>/syslog/http_access.<YYYY>-<MM>-<DD>.log
 /s/<SITE-NAME>/syslog/https_access.<YYYY>-<MM>-<DD>.log

OPTIONS

--follow, -f

No-op, provided just for compatibility with tail Unix command. Heavy tail users might have -f in their muscle memory.

--tail-new

If this option is given, then when a new file appears it will not be read from the beginning but directly tail'ed.

--check-freq=i (default: 1)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-tailswitch.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-tailswitch.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-tailswitch

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

tail Unix command.

tail from ppt.

Logfile::Tail::Switch which is used by this utility.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by perlancar@cpan.org.

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