App-DataDirUtils

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    See CLIs included in this distribution.

DESCRIPTION
    This distribution includes several utilities related to datadirs:

    *   list-datadirs

    A "datadir" is a directory which has a (usually empty) file called
    .tag-datadir. A datadir usually does not contain other datadirs.

    You can backup, rsync, or do whatever you like with a datadir, just like
    a normal filesystem directory. The utilities provided in this
    distribution help you handle datadirs.

FUNCTIONS
  list_datadirs
    Usage:

     list_datadirs(%args) -> [$status_code, $reason, $payload, \%result_meta]

    Search datadirs recursively in a list of directory names.

lib/App/DataDirUtils.pm  view on Meta::CPAN

        },
        {
            summary => 'List all datadirs in all my external drives (show name as well as path)',
            src => '[[prog]] /media/budi /media/ujang -l',
            src_plang => 'bash',
            test => 0,
            'x.doc.show_result' => 0,
        },
        {
            summary => 'Backup all my datadirs to Google Drive',
            src => q{[[prog]] /media/budi /media/ujang -l | td map '"rclone copy -v -v $_->{abs_path} mygdrive:/backup/$_->{name}"' | bash},
            src_plang => 'bash',
            test => 0,
            'x.doc.show_result' => 0,
        },
    ],
};
sub list_datadirs {
    require Cwd;
    require File::Basename;
    require File::Find;

lib/App/DataDirUtils.pm  view on Meta::CPAN


=over

=item * L<list-datadirs>

=back

A "datadir" is a directory which has a (usually empty) file called
F<.tag-datadir>. A datadir usually does not contain other datadirs.

You can backup, rsync, or do whatever you like with a datadir, just like a
normal filesystem directory. The utilities provided in this distribution help
you handle datadirs.

=head1 FUNCTIONS


=head2 list_datadirs

Usage:

script/list-datadirs  view on Meta::CPAN

How many datadirs are here?:

 % list-datadirs . | wc -l

List all datadirs in all my external drives (show name as well as path):

 % list-datadirs /media/budi /media/ujang -l

Backup all my datadirs to Google Drive:

 % list-datadirs /media/budi /media/ujang -l | td map '"rclone copy -v -v $_->{abs_path} mygdrive:/backup/$_->{name}"' | bash

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-DataDirUtils>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-DataDirUtils>.

=head1 AUTHOR



( run in 1.193 second using v1.01-cache-2.11-cpan-49f99fa48dc )