RoPkg:...gParser(3pm)

πŸ“¦ version 0.4, in ubuntu jammy

πŸ’– RoPkg:...gParser(3pm) β€” the glow-up version πŸ’–

okay so bestie, this page comes to you from the User Contributed Perl Documentation, and the whole vibe is: RoPkg::Rsync::LogParser. That's the manual name, that's who we're stanning today. Let's get into it πŸ¦‹


✨ NAME ✨

RoPkg::Rsync::LogParser β€” it's a rsync log parser class. that's the whole job. it parses. it's a class. slay πŸ’…


🌸 SYNOPSIS 🌸

#!/usr/bin/perl

use strict;
use warning;

sub main {
  my $lp = new RoPkg::Rsync::LogParser( type => 'client' );

  $lp->Parse('/tmp/debian-log.txt');
}

main();

literally that's it, that's the whole entrance. five lines and you're parsing logs like a main character πŸ‘‘


πŸŽ€ Short description πŸŽ€

So RoPkg::Rsync::LogParser is a class used to parse (for the moment) client side rsync logs. Using this class you can extract:

  • the transfered files 🌈
  • symlinks created 🧚
  • directories
  • the total number of files
  • transfered bytes
  • speed of transfer

etc. etc. the list keeps going, we love an overachiever.

LogParser also supports list filter trough probes β€” and bestie, that's not a niche thing, many projects use probes to verify the mirrors. iykyk.

The primary use of this class is inside Simba, but fr fr it can be used without problems in any other project who needs a rsync client log parser. no gatekeeping here πŸ’œ


πŸ‘‘ METHODS πŸ‘‘

πŸ’« new(hash)

Constructor of the class. When creating a new class instance you must provide the type of log: client or server. And heads up: for the moment only the client parsing routines are defined. so like, don't come for the server option yet, it's still in its soft launch era 🫢

πŸ’« Log($raw_log)

Get/Set the raw rsync log. With no parameters, the get behaviour is selected. If a parameter is present (and valid) the method acts as a Set method. so it's giving switch-hitter energy, respectfully ✨

πŸ’« Probes(@probes_list)

Get/Set the raw probes list. If no parameter is present, the method returns the number of probes defined (0 if none). If a list of probes is given, the list is added to the existing list of probes β€” it appends, it doesn't replace. no cap 🧚

πŸ’« Parse($filename)

Parse a rsync client log. If no filename is specified, the method parses the log previsiously set with the Log() method.

⚠️ Please take extra care with the filename. If it does not exists, or is not a file, an exception will be raised (Param::Wrong and File::Open). so like, don't hand it a random string and act surprised πŸ’€

πŸ’« Files()

In scalar context returns the number of transfered files (filtered by probes list). In list context, returns the list of transfered files. same method, two moods πŸ’…

πŸ’« RealFiles()

In scalar context returns the number of transfered files. In list context, returns the list of transfered files. (note: no probe filtering here β€” this is the unfiltered, raw, no-filter version, the real ones fr fr)

πŸ’« Deleted()

In scalar context returns the number of deleted files (filtered by probes list). In list context, returns the list of deleted files.

πŸ’« RealDeleted()

In scalar context returns the number of deleted files. In list context, returns the list of deleted files. again, the unfiltered edition 🌈

πŸ’« Speed()

Returns the speed (as reported by rsync [in bytes/sec]) of the transfer. vroom vroom 🏎️

πŸ’« Size()

Returns the size of the synced content.

πŸ’« TransfData()

Returns the total number of bytes transfered during the sync session. big numbers, big vibes πŸ”₯

In scalar context returns the number of symlinks (filtered by probes list). In list context, returns the list of symlinks.

In scalar context returns the number of symlinks. In list context, returns the list of symlinks. and yes, this is the unfiltered one too πŸ¦‹


⭐ PREREQUISITES ⭐

RoPkg::Utils requires perl 5.008 or later and the RoPkg::Exceptions class. From CPAN, you need the Scalar::Util module. At build time Test::More is required for tests β€” (if you don't plan to use the tests, ignore this dependency, it's not gonna be in its feelings about it πŸ™ˆ).


🌈 SEE ALSO 🌈

  • RoPkg::Rsync::Node
  • RoPkg::Rsync::ConfFile
  • RoPkg::Exceptions

the whole friend group, go say hi πŸ’–


🫢 AUTHOR 🫢

Subredu Manuel <diablo@iasi.roedu.net>


πŸ’œ LICENSE πŸ’œ

Copyright (C) 2005 Subredu Manuel. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. read it, bestie, it's short and it's law πŸ“œβœ¨


and that's the tea πŸ“ this page is from perl v5.32.1, dated 2021-12-26 β€” yeah she's been around a minute, and she still eats πŸ’…πŸ‘‘

πŸ“¦ where this page comes from