App-BorgRestore

 view release on metacpan or  search on metacpan

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


=head1 DESCRIPTION

App::BorgRestore is a restoration helper for borg.

It maintains a cache of borg backup contents (path and latest modification
time) and allows to quickly look up backups that contain a path. It further
supports restoring a path from an archive. The archive to be used can also be
automatically determined based on the age of the path.

The cache has to be updated regularly, ideally after creating or removing
backups.

L<borg-restore.pl> is a wrapper around this class that allows for simple CLI
usage.

This package uses L<Log::Any> for logging.

=head1 METHODS

=head2 Constructors

lib/App/BorgRestore/PathTimeTable/DB.pm  view on Meta::CPAN

	use constant TRACE => $log->is_trace;
}

=head1 NAME

App::BorgRestore::PathTimeTable::DB - Directly write new archive data to the database

=head1 DESCRIPTION

This is used by L<App::BorgRestore> to add new archive data into the database.
Data is written to the database directly and existing data is updated where necessary.

For performance reasons this class keeps an internal cache so that the database
is only contacted when necessary. The cache assumes that the path are sorted so
that all files from one directory are added, before files from another. If a
path from a different directory is added, the previous cache is invalidated.
Upon invalidation the time stamp is written to the database. If paths are
properly sorted, this results in only a single database write for each path.

=cut

lib/App/BorgRestore/Settings.pm  view on Meta::CPAN


The size of the in-memory cache of sqlite in kibibytes. Increasing this may
reduce disk IO and improve performance on certain systems when updating the
cache.

=item C<$prepare_data_in_memory>

Default: 0

When new archives are added to the cache, the modification time of each parent
directory for a file's path are updated. If this setting is set to 1, these
updates are done in memory before data is written to the database. If it is set
to 0, any changes are written directly to the database. Many values are updated
multiple time, thus writing directly to the database is slower, but preparing
the data in memory may require a substaintial amount of memory.

New in version 3.2.0. Deprecated in v3.2.0 for future removal possibly in v4.0.0.

=back

=head2 Example Configuration

 $borg_repo = "/path/to/repo";



( run in 0.342 second using v1.01-cache-2.11-cpan-05444aca049 )