Commit Graph

599 Commits

Author SHA1 Message Date
Michael Eischer e1a5550a27 test: use generics in Equal function signature
This simplifies comparing a typed value against nil. Previously it was
necessary to case nil into the proper type.
2026-01-31 20:03:38 +01:00
Michael Eischer 1e6ed458ff remove old // +build comments 2025-11-30 11:53:23 +01:00
Michael Eischer 7e80536a9b Merge pull request #5472 from wplapper/cmd_copy_stream
restic copy --stream: run one large copy operation crossing snapshot boundaries - issue #5453
2025-11-26 20:57:46 +01:00
Winfried Plappert b87f7586e4 restic copy --batch: a fresh start from commit 382616747
Instead of rebasing my code, I decided to start fresh, since WithBlobUploader()
has been introduced.

changelog/unreleased/issue-5453:
doc/045_working_with_repos.rst:
the usual

cmd/restic/cmd_copy.go:
gather all snaps to be collected - collectAllSnapshots()
run overall copy step - func copyTreeBatched()
helper copySaveSnapshot() to save the corresponding snapshot

internal/repository/repack.go:
introduce wrapper CopyBlobs(), which passes parameter `uploader restic.BlobSaver` from
WithBlobUploader() via copyTreeBatched() to repack().

internal/backend/local/local_windows.go:
I did not touch it, but gofmt did: whitespace
2025-11-19 07:09:24 +00:00
Michael Eischer 1caeb2aa4d rclone: fix rare test failure if rclone cannot be started 2025-11-16 20:14:21 +01:00
Michael Terry 7f3e3b77ce backend/local: fix "operation not supported" when unlocking
If the repo is on a mounted folder that doesn't support chmod (like
SMB), it was causing an "operation not supported" error when trying to
chmod 666 a file before deleting it.

But it isn't generally needed before deleting a file (the folder
permissions matter there, not the file permissions). So, just drop it.
2025-11-16 08:09:51 -05:00
Michael Eischer 71432c7f4b Merge pull request #5555 from MichaelEischer/extract-globaloptions
Split globalOptions into separate package
2025-10-12 18:31:44 +02:00
Michael Eischer 394c8de502 add package to create a prepopulated backend registry 2025-10-12 17:56:28 +02:00
Srigovind Nayak e65ee3cba8 fix: keep the PutBlock Size to 100 MiB
No complaints in the past.
2025-10-05 21:41:26 +05:30
Srigovind Nayak 34a94afc48 azure: update upload size constants to reduce memory allocation 2025-10-05 21:41:25 +05:30
Srigovind Nayak 9bcd09bde0 azure: reduce singleBlockMaxSize to accommodate 32-bit systems 2025-10-05 21:41:25 +05:30
Srigovind Nayak e80e832130 azure: remove saveSmall, use only PutBlob API 2025-10-05 21:41:25 +05:30
Srigovind Nayak dd2d562b7b azure: enhanced upload with single PutBlob API and configurable upload methods 2025-10-05 21:41:25 +05:30
Rani 3ae6a69154 Bugfix(sftp): fix loose permissions on sftp backend. (#5497) 2025-10-03 18:20:52 +00:00
Michael Eischer fd241b8ec7 Merge pull request #5527 from MichaelEischer/drop-s3-static-credentials
s3: drop manual credentials loading from environment
2025-10-03 19:57:55 +02:00
Michael Eischer 4dc71f24c5 backends: pass error logger to backends 2025-10-03 18:22:42 +02:00
Michael Eischer a30a36ca51 s3: drop manual credentials loading from environment
credentials.EnvAWS offers a superset of the manually implemented
credentials loading. Rework the error message that is shown if no
credentials were found but either access or secret key are set.
2025-09-24 21:02:02 +02:00
Michael Eischer 7257cd2e5f extra linters 2025-09-21 22:24:35 +02:00
Michael Eischer 60d80a6127 Fix linter warnings 2025-09-21 22:24:15 +02:00
Michael Eischer 6ff7cd9050 backend/util: extract background handling code 2025-09-08 10:42:35 +02:00
greatroar 1ed93bd54d backend,termstatus: Unify foreground/background detection
PR #5358 reintroduced a version of the TIOCGPGRP ioctl call that works
on all Unix platforms except Linux, due to a bug/inconsistency in
x/sys/unix. This commit fixes that by introducing termstatus.Tcgetpgrp.

It also introduces termstatus.Getpgrp and termstatus.Tcsetpgrp to deal
with the different signature of unix.Getpgrp in Solaris vs. all other
Unix platforms and an int-overflowing constant on AIX, so that some
AIX/Solaris-specific code can be removed elsewhere and
foreground/background detection is done the same everywhere except on
Windows.
2025-09-08 09:33:44 +02:00
Michael Eischer 914bd699be backend: always start backend process in separate process group
The process group is necessary to properly handle ctrl-c.
2025-09-06 19:51:10 +02:00
Michael Eischer 4c19d6410f backend: only move child process to foreground if already in foreground
The rclone and sftp backends require starting a child process. The are
first moved into the foreground and back into the background after the
initial startup is done.

However, this behavior is also active if restic itself is started in the
background. In this case, restic changing the foreground process may
confuse the shell and in case of bash causes it to exit. Thus, disable
modification of the controlling process group of the tty if restic is
run in the background.
2025-09-06 19:51:10 +02:00
Dominik Schulz 48e5c0984e Mark HTTP Error 507 as permanent
This change classifies HTTP error 507 (Insufficient Storage) as a
permanent error that should not be retried. I keep running into
this once in a while and there is literally no point in retrying when
the server is full.

Fixes #5429

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2025-09-05 19:04:16 +02:00
Michael Terry a8535aba58 backend/local: ignore chmod "not supported" errors 2025-06-02 17:44:30 -04:00
Gilbert Gilb's eefff0d793 docs: fix unit for S3 restore timeout
"d" is not a valid unit.
2025-03-27 21:20:50 +01:00
Michael Eischer 9eee32131a Merge pull request #5307 from Martin2112/dial_tls
Replace deprecated DialTLS with DialTLSContext.
2025-03-25 18:12:10 +01:00
Michael Eischer 0b22d8dc64 Merge pull request #5306 from MichaelEischer/sftp-better-errors
sftp: improve error messages
2025-03-24 18:43:47 +01:00
Martin Smith 47b048f437 Rename param as it looks like context isn't used. 2025-03-24 15:01:47 +00:00
Martin Smith cd7f384d77 Replace deprecated DialTLS with DialTLSContext. 2025-03-24 14:05:13 +00:00
Michael Eischer 9aad8e9ea5 Merge pull request #5299 from Martin2112/go_cleanup
A few more small cleanups that should not change behaviour.
2025-03-24 13:59:39 +01:00
Michael Eischer 3adf7d4efb backend/sftp: wrap further errors 2025-03-24 12:45:15 +01:00
Michael Eischer 66ec735ac2 backend/sftp: include file path in error messages 2025-03-24 12:44:42 +01:00
Michael Eischer 63a71f70e3 backend/sftp: ensure all errors are wrapped with the method name 2025-03-24 12:32:52 +01:00
Michael Eischer 4b975bda37 backend/s3: increase timeout for test initialization 2025-03-23 17:28:08 +01:00
Michael Eischer f8b481fd9b backend/s3: resolve credential retrieval deprecation 2025-03-23 17:28:08 +01:00
Michael Eischer 4350b95d27 backend/test: fix delayedRemoval timeout handling
The timeout for all blobs starts to run after the delete calls have been
issue. Thus, use the same start time for all blobs instead of individual
timeouts.
2025-03-23 16:36:31 +01:00
Michael Eischer 2e58561ad6 backend/test: remove redundant test call to the backend 2025-03-23 16:36:31 +01:00
Michael Eischer 17b585f7c7 backend/test: partially parallelize delayedRemove 2025-03-23 16:36:31 +01:00
Michael Eischer 4640b3c41a backend/test: parallelize slow tests 2025-03-23 16:36:31 +01:00
Martin Smith 4420fde378 Remove deprecated HTTP option that is now the default. 2025-03-23 10:10:54 +00:00
Martin Smith f238f81ba6 Renames to fix clashes with reserved words. 2025-03-22 18:20:30 +00:00
Martin Smith 3788605127 Rename unused parameters to '_'. 2025-03-22 18:20:30 +00:00
Martin Smith 092899df8b Remove unnecessary type conversions. 2025-03-22 18:20:30 +00:00
Martin Smith db8daeb192 Fix godoc comments. 2025-03-22 18:20:30 +00:00
Michael Eischer 445477312c Merge pull request #5251 from MichaelEischer/rclone-retries
Retry temporary rclone backend errors
2025-03-22 14:24:47 +01:00
Luz Paz 794341a494 doc: fix various typos
Found via `codespell -q 3 -L atleast,iinclude,ist,programm,reenable,ser,uptodate`
2025-03-05 20:47:08 -05:00
Michael Eischer 5e7ce45ede retry: test error retries for flaky backends 2025-02-16 22:56:43 +01:00
Michael Eischer cb8575f001 rclone: remove redundant Warmup methods 2025-02-16 22:41:22 +01:00
Michael Eischer 8d1185b3b8 retry/rclone: retry errors up to 5 times 2025-02-16 22:40:55 +01:00