Commit Graph
67 Commits
Author SHA1 Message Date
Kenneth SkovhedeandGitHub 4b2402d381 Merge pull request #6733 from duplicati/feature/fix-issue-6539
Fix issue with failed delete
2026-01-30 16:19:59 +01:00
Carl-Johannes JohnsenandGitHub 6b02116bed Merge pull request #6708 from carljohnsen/feature/automatic-321
Feature/Automatic 3-2-1 backup
2026-01-28 17:21:33 +01:00
Kenneth SkovhedeandGitHub 3e0aedd8b6 Merge branch 'master' into feature/fix-issue-6539 2026-01-28 15:44:28 +01:00
Kenneth Skovhede 90a56ff33e Fix issue with failed delete
If the delete call fails, the file will be marked as "deleted" in the database even though it may not actually be deleted.

Once the delete grace time expires, Duplicati will refuse to run backups as a "new" file is found in the destination folder.

This PR changes the logic to track if the file was actually deleted, and will not mark the file deleted until the delete call reports success.

This fixes #6539
2026-01-28 15:03:23 +01:00
Kenneth Skovhede 8996955dc1 Added a soft-delete feature
This PR adds an option to give a soft-delete prefix. If the prefix is set, files are renamed instead of actually being deleted. For backends that support life-cycle rules, this can be used to provide protection agains accidental deletion.

The intended use is that the client credentials do not have permissions to delete files, but can rename files. When a file is soft-deleted, it is then renamed and no longer "visible" to Duplicati. The destination can then have lifecycle rules that deletes files with the designated prefix after a set interval, or by another service that has permissions to actually delete files.
2026-01-27 14:10:31 +01:00
Carl Johnsen 5d094cef02 Removed unnecessary usings 2026-01-15 11:56:20 +01:00
Carl Johnsen 177272ecd9 Merge branch 'master' into feature/automatic-321 2026-01-08 20:55:31 +01:00
Carl Johnsen 8519e3f591 Promoted LightWeightBackendManager to the main Duplicati library 2026-01-08 14:26:26 +01:00
Kenneth Skovhede 0f81b42146 Add support for remote locks
This PR adds support for locking files if the backend supports it.

To activate locking, set the option `--file-lock-duration=30D` and the backup will lock the files.

If the database is rebuilt with the intention of continuing the backups, use the option `--repair-refresh-lock-info` which will update lock information in the database after recreating the database.

The locking works by asking the backend to lock files after a backup has completed.

The implementation keeps track of which files are currently assigned a lock and prevents attempting to delete the files that are currently locked.

Note that the bucket should not have a default lock policy as Duplicati needs to finish the backup before the locking is applied.

In this initial version, Azure Blob Storage, B2, S3 and iDrive are supported with locking.

The CLI is updated to allow setting locks on a specific version. The backend tool is updated to allow setting locks on specific files.
2025-12-14 17:17:48 +01:00
Kenneth Skovhede 012aeed7de Add dynamic streaming toggle
This PR adds a dynamic property so a backend can signal if it supports streaming, based on the settings.

This is currently used for the File backend, so that toggling `--use-move-for-put` will disable streaming on the backend instead of relying on the `--disable-streaming-transfers` flag.
2025-11-03 12:48:37 +01:00
Kenneth Skovhede 777bc06842 Report remote filename on hash errors
This PR changes the reported filename to use the remote filename instead of the random temporary filename that has little value to the user as the file is deleted immediately after the error is raised.
2025-10-27 11:37:10 +01:00
Kenneth Skovhede b955822773 Better capture of rethrown exception 2025-07-04 16:14:04 +02:00
Carl Johnsen a3d2ffbcd0 Removed whitespace 2025-06-23 10:27:35 +02:00
Carl Johnsen 6ee76a29d3 Made the callback on a put command to the backend be a function returning an awaitable Task rather than an Action. 2025-06-23 10:27:09 +02:00
Carl Johnsen 31c5441bdb Forwarded cancellation tokens, added some missing .ConfigureAwait() and added some missing docstrings 2025-06-19 11:04:09 +02:00
Carl Johnsen e81100de04 Started on adding docstrings 2025-06-17 09:59:22 +02:00
Carl Johnsen 3d11a05400 Added .ConfigureAwait(false) to all of the await statements 2025-06-12 08:34:29 +02:00
Carl Johnsen f411260c03 Removed TODO in comments on newly introduced commits due to how the pre Microsoft.Data.Sqlite backend would make nested transactions 2025-06-11 09:11:35 +02:00
Carl Johnsen 85e6f45338 Moved some of the commits to transactions outside of database methods, as this more closely mimics the commit flow of the old IDb backend.
This was especially needed due to the Microsoft.Data.Sqlite backend not supporting nested transactions.
2025-06-03 21:44:55 +02:00
Carl Johnsen bd493638af Merge branch 'master' into performance/mssqlite-async 2025-06-02 10:39:33 +02:00
Kenneth Skovhede 720062b60b Merge remote-tracking branch 'origin/master' into feature/remove-http-options 2025-05-28 21:40:41 +02:00
Kenneth Skovhede ff141d9456 Improved stop handling during backend retries 2025-05-28 21:39:31 +02:00
Kenneth Skovhede fb08a0b174 Fixed an issue with retry downloads causing errors 2025-05-28 12:49:29 +02:00
Kenneth Skovhede c8b9fb5c73 Websocket subscriptions
This PR adds the ability to subscribe to messages over a websocket.

To prevent polling data, the server can now push messages through the websocket, so the client can instantly update when new data is available.

The change is backwards compatible, still serving the status updates over the socket. If the client is providing the authentication token, it is auto-subscried to the legacy status message.

If the client is using the new authentication message, it needs to subscribe to get the status updates (and any other services it needs).

The event system has been extended to support new, and more accurate, events. This is the first step towards removing the general status update and the long-poll mechanism.

This also re-introduces the blocking marker, so the client can know if the operation is halted due to too many pending transfers.

Some endpoints have been moved to service implementations, to allow serving the exact same data from both endpoints and websocket.

This PR also updates the way the progress is handled, so that all transfers are returned to the client, and the transfer speeds for each transfer is calculated based on a small sample buffer, so the values are more accurate even if the program is paused during transfers.
2025-05-27 12:13:07 +02:00
Carl Johnsen ee40767412 Merge branch 'master' into performance/mssqlite-async 2025-05-27 12:04:50 +02:00
Kenneth SkovhedeandGitHub 6f5505f2a2 Merge pull request #6279 from duplicati/feature/issue2685
Default disable throttle for local destinations
2025-05-26 08:29:29 +02:00
Kenneth Skovhede 14741a3b43 Removed some checks for WebException that is no longer used.
Changed throwing WebException to throwing HttpRequestException
2025-05-23 14:02:03 +02:00
Carl Johnsen a37f0dda31 Merge branch 'master' into performance/mssqlite-async 2025-05-22 14:09:17 +02:00
Carl Johnsen 46f394d6d5 Updated the BackendManager implementation to not pass down transactions (as they should be implicitly handled by the databases) and to use the new async database methods 2025-05-22 08:07:23 +02:00
Kenneth Skovhede a4234a342c Default disable throttle for local destinations
This PR adds the option to disable throttle on a backup, so it will ignore throttle settings both from the server and the job.

Additionally, a list of backend keys can be provided, where backups will disable throttling. This can be used to set advanced options with a set of backends that should not be throttled.

By default, the `file` backend is now exempt from throttling by default.
This fixes #2685
2025-05-20 19:06:35 +02:00
Kenneth SkovhedeandGitHub 697a0b62d0 Merge pull request #6271 from duplicati/feature/issue6200
Flush messages after backup stop
2025-05-20 17:00:07 +02:00
Kenneth Skovhede 40b2ab4a70 Fixed case where warnings would be emitted during clean shutdown 2025-05-20 15:41:39 +02:00
Kenneth Skovhede e4689431cb Fix after moving namespace 2025-05-20 14:28:46 +02:00
Kenneth Skovhede 04c7ec5287 Flush messages after backup stop
This change now flushes all pending messages from the backendmanager to the database, even if the main operation crashes (or is stopped).

This ensures that the database and remote storage are more in sync.

Also removed a redundant warning from the backendmanager during shutdown, and simplified a check for active operations.

This fixes #6200
2025-05-20 09:23:29 +02:00
Kenneth SkovhedeandGitHub da02a93978 Merge branch 'master' into feature/fix-throttle-speeds 2025-04-25 13:58:53 +02:00
Kenneth Skovhede f88635717d Merge remote-tracking branch 'origin/master' into feature/fix-throttle-speeds 2025-04-24 21:49:11 +02:00
Kenneth Skovhede 46f5efd178 Merge branch 'master' into feature/support-glacier-style-non-readable-files 2025-04-23 22:37:31 +02:00
Kenneth Skovhede 3ff868b0f9 Removed tracking of files sizes, and implemented it with a database lookup 2025-04-23 15:39:32 +02:00
Kenneth Skovhede 66862043b6 Fixed a case where the transactions were not used, despite being active 2025-04-23 13:44:46 +02:00
Kenneth Skovhede e6ba6098d7 Implemented immediate transaction commits for almost all uploads.
This ensures that files cannot appear on the remote destination, despite terminating the host program.

This fixes #4485

There is still work needed to handle the repair and compact operations so they use transactions and can commit changes during transfer progress.
2025-04-23 12:11:16 +02:00
Kenneth Skovhede f393c00030 Fixed throttle support
This moves the throttle support to the StreamUtil throttled stream, which allows multiple streams to share a throttle value, such that the throttle setting is applied to the entire communication from Duplicati, and not for each connection.

This also cleans up a bit in the progress reporting, where the backend manager now keeps track of the "active" transfer and only emits progress on that. Once it finishes, a new transfer is promoted a "active".
2025-04-22 22:54:48 +02:00
Marcelo C. d528ef6278 Fix Resource Leak in BackendManager Connection Handling
While investigating issue [#6103](https://github.com/duplicati/duplicati/issues/6103), found that connections were not disposed due to the backend pool in BackendManager's handler. Set up a FileZilla server to test the issue before and after the change, confirming that connections now close as expected with this fix.
2025-04-08 11:24:14 -03:00
Kenneth Skovhede dd07dabee1 Merge commit 'b1f705f71a39e4ea79c7dae56bfd0fb345af5110' into feature/support-glacier-style-non-readable-files 2025-03-18 20:44:05 +01:00
Kenneth SkovhedeandGitHub eac394f0a3 Merge pull request #6011 from duplicati/feature/improved-failure-resilience
Improved failure resilience
2025-03-12 14:48:14 +01:00
Carl Johnsen f77fcc186c Merge remote-tracking branch 'upstream/master' into bugfix/restore-deadlock 2025-03-10 05:50:26 +01:00
Kenneth Skovhede 58da574130 Moved shutdown logic into separate method so it can be called for both uploads and downloads 2025-03-07 15:19:40 +01:00
Kenneth Skovhede 4e60a7ad49 Merge remote-tracking branch 'origin/master' into feature/improved-failure-resilience 2025-03-06 12:09:42 +01:00
Kenneth Skovhede 1321488527 Improve failure detection
This commit adds extra logic to prevent cases where the backup reports success but leaves behind partial files.

A new flag is recorded to track if partial files are possible. If no partial files are possible, the verification will fail if any are found.
2025-03-06 12:02:11 +01:00
Kenneth Skovhede 4f62a8a413 Fixed off-by-one for retry count 2025-03-05 09:04:46 +01:00
Carl Johnsen 3596e0ebd3 When profiling a get, it's worthwhile knowing where the remote file is being stored locally 2025-03-04 19:54:40 +01:00