summaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2020-09-27Checking in changes prior to tagging of version 3.4.1.Florian Pritz1-1/+1
Changelog diff is: diff --git a/Changes b/Changes index f77e9f9..cd1a4c3 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for Perl extension App-BorgRestore {{$NEXT}} + +3.4.1 2020-09-27T12:57:01Z - Fix missing cache data for files that exist with and without an extension. For example '/home/*/.ssh/id_rsa' would be missing from the database and only the accompanying `id_rsa.pub` file would be contained
2020-09-27DB: Fix incorrect subpath handling for path that is a superstring of theFlorian Pritz2-2/+38
previous path Files that share a common substring (e.g. `/home/foo/.ssh/id_rsa` and `/home/foo/.ssh/id_rsa.pub`) could incorrectly trigger an optimization that was only supposed to be triggered if the first path is a directory. The first path would then not be added to the database cache even though it should have been. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-09-28Checking in changes prior to tagging of version 3.4.0.Florian Pritz1-1/+1
Changelog diff is: diff --git a/Changes b/Changes index eeb4d3b..dd5812e 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for Perl extension App-BorgRestore {{$NEXT}} + +3.4.0 2019-09-28T13:28:49Z - Remove archive name untaint restrictions (remove untaint_archive_name function)
2019-09-28Import untaint function where usedFlorian Pritz4-16/+16
Better code readability than with the full name. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-09-28Helper: Export untaintFlorian Pritz1-0/+3
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-09-28Helper: Remove untaint_archive_nameFlorian Pritz4-12/+4
We no longer need a special whitelist for archive names since the database no longer uses them as column keys. We still need to untaint variables that are passed to DBI so we use untaint() for this now. We also move the location of the untaint call closer to its usage with DBI/system() to prevent untainted data from leaking elsewhere. Fixes #4 Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-09-28DB: Convert timestamp column names to numeric IDsFlorian Pritz1-7/+23
Having the backup archive names in the table columns is not strictly necessary. Replace this with numeric IDs and map them via the `archives` table so that we can eventually remove untaint_archive_name(). Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-09-28DB: Use get_archive_id instead of _prefix_archive_idFlorian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-09-28DB: Apply migration is correct orderFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-09-28DB: Implement version based database schema upgradesFlorian Pritz1-6/+34
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-02-07Checking in changes prior to tagging of version 3.3.0.Florian Pritz1-1/+1
Changelog diff is: diff --git a/Changes b/Changes index 807706c..9bb5022 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for Perl extension App-BorgRestore {{$NEXT}} + +3.3.0 2019-02-07T16:18:41Z - Support borg list's --prefix option via $borg_prefix setting - Properly handle cases where the DB is empty after removal of archive information
2019-02-07Support borg list --prefix option via settingFlorian Pritz3-4/+17
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2019-02-07DB/remove_archive: Properly handle cases where the DB is empty after removalFlorian Pritz1-7/+13
Empty here means that the DB does not contain any backup archive information because all information that is already in the db has to be removed. The old code tries to copy existing data into the new table, but since there are no archives to copy data for, the sql query fails. Also, it would copy all rows and only populate the path column, but if there are no archives that have timestamps, that's actually useless work. This patch ensures that the table is kept empty if there are no archives. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-11-12Enable trace logging in BEGIN block for test suiteFlorian Pritz1-4/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-11-01Checking in changes prior to tagging of version 3.2.1.Florian Pritz1-1/+1
Changelog diff is: diff --git a/Changes b/Changes index b9b6218..dae2435 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,9 @@ Revision history for Perl extension App-BorgRestore {{$NEXT}} +3.2.1 2018-11-01T12:54:26Z + - Add missing version requirement to List::Util dependency + 3.2.0 2018-09-19T11:46:35Z - Write data directly to DB instead of preparing it in memory first. The new algorithm should be faster and uses constant memory. If you want the
2018-09-19Checking in changes prior to tagging of version 3.2.0.Florian Pritz1-1/+1
Changelog diff is: diff --git a/Changes b/Changes index bd95acb..b9b6218 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for Perl extension App-BorgRestore {{$NEXT}} + +3.2.0 2018-09-19T11:46:35Z - Write data directly to DB instead of preparing it in memory first. The new algorithm should be faster and uses constant memory. If you want the old one back for any reason look at the '$prepare_data_in_memory' config
2018-09-13Change prepare_data_in_memory default to 0 to enable direct-to-dbFlorian Pritz1-5/+6
Also instantly deprecate the option since it is only a short term fix in case someone notices problems with the new code. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-12Remove duplicate code by calling add_path in save_nodesFlorian Pritz1-17/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-12Update cache only when going back up the stack instead of all the timeFlorian Pritz1-9/+13
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-12Only add top level directory when we actually have a top level directoryFlorian Pritz1-2/+4
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-12Ensure that top level directories are also written to the DBFlorian Pritz1-0/+4
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-10Remove left over debug log entryFlorian Pritz1-1/+0
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09PathTimeTable/DB: Use cache as kind of stack and only write to DB when ↵Florian Pritz1-18/+25
removing an item from the stack Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09DB: Fix update_path_if_greater not working for existing rowsFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09PathTimeTable/DB: Use constant to control trace loggingFlorian Pritz1-6/+8
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09PathTimeTable/DB: Improve performance by removing usage of regex in hot placesFlorian Pritz1-6/+10
This cuts execution time on my workstation from about 85 seconds for an --update-cache adding one archive to roughly 62 seconds. Measured totally unscientifically by simply running the full application instead of isolating the code, but it makes sense that regexes are slower so I'll take it. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09Use strictures instead of strict/warningsFlorian Pritz7-14/+7
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09Get settings via hash instead of direct variable accessFlorian Pritz2-23/+25
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09Settings: Add constructorsFlorian Pritz2-12/+27
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09Settings: Pull config file loading into functionFlorian Pritz1-13/+18
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09Settings: Use Function::ParametersFlorian Pritz1-6/+5
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09Simplify BorgRestore constructorsFlorian Pritz1-8/+4
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09BorgRestore: Move dependencies to dedicated $self->{deps} keyFlorian Pritz1-28/+28
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-09PathTimeTable/DB: Add cache to reduce number of DB callsFlorian Pritz1-2/+51
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-06Update copyright yearsFlorian Pritz2-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-06Add direct-to-db adding of paths instead of memory onlyFlorian Pritz5-10/+101
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-09-06Extract lookup table into dedicated packageFlorian Pritz2-43/+71
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-08-25Checking in changes prior to tagging of version 3.1.0.3.1.0Florian Pritz1-1/+1
Changelog diff is: diff --git a/Changes b/Changes index a4b127d..a7d4b7b 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for Perl extension App-BorgRestore {{$NEXT}} + +3.1.0 2018-08-25T09:46:27Z - Add --json option - Add --detail option - Log cache update status message per archive to INFO
2018-08-19Remove unused variableFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-08-19DB: Do not create directories for special :foo: DBsFlorian Pritz1-1/+4
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-08-17Die when XDG_* and HOME env vars are not setFlorian Pritz1-5/+17
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-08-02Remove sqlite cache size warningFlorian Pritz2-5/+5
The original performance problem on my machine doesn't seem to be reproducable any more so maybe either sqlite got smarter or it was something else entirely. Move the warning to DEBUG and soften the documentation. If it still helps people can use it, but we don't have to annoy them if it doesn't. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-08-02Send cache update messages to INFOFlorian Pritz1-2/+2
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-03-23Checking in changes prior to tagging of version 3.0.0.3.0.0Florian Pritz1-1/+1
Changelog diff is: diff --git a/Changes b/Changes index 22043d6..600f118 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for Perl extension App-BorgRestore {{$NEXT}} + +3.0.0 2018-03-23T14:57:52Z - No longer automatically enable --adhoc when cache is empty 2.3.0 2018-02-06T15:58:36Z
2018-02-06Checking in changes prior to tagging of version 2.3.0.2.3.0Florian Pritz1-1/+1
Changelog diff is: diff --git a/Changes b/Changes index 32e7b5b..a46f8bc 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,11 @@ Revision history for Perl extension App-BorgRestore {{$NEXT}} +2.3.0 2018-02-06T15:58:36Z + - Add --list option to search for paths occuring in backups + - Warn if sqlite's memory cache is is filled during cache updates + - Improve documentation of @backup_prefixes setting + 2.2.0 2017-11-25T23:16:04Z - Add borg 1.1 support - Mention required positive return code of config in documentation
2018-01-24Only increase sqlite cache size during updateFlorian Pritz2-4/+9
While not all operations fill the cache, --list does. However, for read operations it doesn't actually appear to help performance. Limit the large cache setting to update operations only because there it does really increase performance. Signed-off-by: Florian Pritz <bluewind@xinu.at>
2018-01-24Add --list feature to search for files contained in backups by pathFlorian Pritz2-0/+31
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-12-04Warn if sqlite cache is fullFlorian Pritz2-0/+14
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-12-03Settings: Fix missing indentation in docFlorian Pritz1-1/+1
Signed-off-by: Florian Pritz <bluewind@xinu.at>
2017-12-02Properly document removal of prefixes via @backup_prefixesFlorian Pritz1-4/+9
Signed-off-by: Florian Pritz <bluewind@xinu.at>