Skip to content

Commit 00621ae

Browse files
committed
Radically improve speed of incremental backups (check recent snapshots first)
1 parent 0a1fcc0 commit 00621ae

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.x (Unreleased yet)
2+
* Radically improve speed of incremental backups (check recent snapshots first)
3+
14
# 0.5 (17 May, 2015)
25
* Code moved into class
36
* Fix for Ubuntu 15.10 (binaries moved from `/usr/sbin` to `/bin`, now both cases are supported)

just-backup-btrfs.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,16 @@ protected function determine_mount_point ($destination_external) {
261261
protected function get_last_common_snapshot ($history_db, $history_db_external) {
262262
$snapshots = $history_db_external->query(
263263
"SELECT `snapshot_name`
264-
FROM `history`"
264+
FROM `history`
265+
ORDER BY `date` DESC"
265266
);
266267
while ($snapshot = $snapshots->fetchArray(SQLITE3_ASSOC)['snapshot_name']) {
267268
$snapshot_escaped = $history_db->escapeString($snapshot);
268269
$snapshot_found = $history_db
269270
->query(
270271
"SELECT `snapshot_name`
271-
FROM `history`
272-
WHERE `snapshot_name` = '$snapshot_escaped'"
272+
FROM `history`
273+
WHERE `snapshot_name` = '$snapshot_escaped'"
273274
)
274275
->fetchArray();
275276
if ($snapshot_found) {

0 commit comments

Comments
 (0)