From 30e4416f8f0191dad4701fadcc55a34ba80c090d Mon Sep 17 00:00:00 2001 From: Fuxino Date: Thu, 8 Oct 2026 18:11:25 +0200 Subject: [PATCH] Look for the last backup after removing old ones With --remove-before-backup, the last backup was selected for --link-dest before old backups were removed, so with keep=0 rsync was given a directory that no longer existed. --- simple_backup/simple_backup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/simple_backup/simple_backup.py b/simple_backup/simple_backup.py index 2fcefbf..8eaf50d 100755 --- a/simple_backup/simple_backup.py +++ b/simple_backup/simple_backup.py @@ -515,7 +515,6 @@ class Backup: _notify('Starting backup...') self.define_backup_dir() - self.find_last_backup() fd, self._inputs_path = mkstemp(prefix='tmp_inputs', text=True) count = 0 @@ -549,6 +548,9 @@ class Backup: if self.keep != -1 and self._remove_before: self.remove_old_backups() + # Only look for the last backup now, as it may have been removed above + self.find_last_backup() + logger.info('Copying files. This may take a long time...') if self._last_backup == '':