App-TaggedDirUtils

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


DESCRIPTION
    This distribution includes several utilities related to tagged
    directories:

    *   list-tagged-dirs

    A "tagged directory" is a directory which has one or more tags: usually
    empty files called .tag-TAGNAME, where *TAGNAME* is some tag name.

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

FUNCTIONS
  list_tagged_dirs
    Usage:

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

    Search tagged directories recursively in a list of places.

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

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

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


=over

=item * L<list-tagged-dirs>

=back

A "tagged directory" is a directory which has one or more tags: usually empty
files called F<.tag-TAGNAME>, where I<TAGNAME> is some tag name.

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

=head1 FUNCTIONS


=head2 list_tagged_dirs

Usage:

script/list-tagged-dirs  view on Meta::CPAN

How many datadirs are here?:

 % list-tagged-dirs --has-tag datadir --lacks-file .git . | wc -l

List all media tagged directories in all my external drives (show name as well as path):

 % list-tagged-dirs --has-tag media --lacks-file .git -l /media/budi /media/ujang

Backup all my mediadirs to Google Drive:

 % list-tagged-dirs --has-tag media --lacks-file .git -l /media/budi /media/ujang | 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-TaggedDirUtils>.

=head1 SOURCE

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

=head1 AUTHOR



( run in 1.716 second using v1.01-cache-2.11-cpan-bbb979687b5 )