-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--stdin-filename with path separator gives cryptic error message #2063
Comments
As a follow up, I believe the stat errors are coming from restic trying to build the tree objects. I don't know for certain, but I suspect that with So I think the fix here is just to make restic able to handle absolute paths to |
Thanks for the report, it's a bug! |
As pointed out, the error is caused by the parent directories. The fs.Reader Lstat() method succeeds for the filename (e.g. Updated Lstat() to also allow the parent directory components of the filename. Not sure if it makes sense to also allow relative directory paths, given that the snapshot path is prepended with "/" so will always be absolute? |
Return valid directory info from Lstat() for parent directories of the specified filename. Previously only "/" and "." were valid directories. Also set directory mode as this is checked by archiver. Closes restic#2063
Return valid directory info from Lstat() for parent directories of the specified filename. Previously only "/" and "." were valid directories. Also set directory mode as this is checked by archiver. Closes restic#2063
Return valid directory info from Lstat() for parent directories of the specified filename. Previously only "/" and "." were valid directories. Also set directory mode as this is checked by archiver. Closes restic#2063
Output of
restic version
How did you run restic exactly?
RESTIC_REPOSITORY
set to S3 bucket+prefix, andRESTIC_PASSWORD
set appropriately.What backend/server/service did you use to store the repository?
S3
Expected behavior
The backup should complete successfully, or at least a useful error message should be provided. I would not expect Restic to need to stat anything as part of this operation; the repository is in S3 and the file data is provided on standard input.
Actual behavior
Restic gives a "file does not exist" error message.
Steps to reproduce the behavior
Attempt to upload a file with
--stdin-filename
containing a path separator.Do you have any idea what may have caused this?
It appears that Restic joins the provided filename to the current working directory Restic is run from; when I omit
/root/
then the file is stored in the repository as/root/postgresql-dump.sql
(cwd for the command is/root
).Do you have an idea how to solve the issue?
I would suspect this needs a patch to be fixed. A workaround is to
cd
before running Restic so that it's running from the directory where you want the backed-up file to appear to be stored.Did restic help you or made you happy in any way?
Yes, this has become my go-to backup tool for all of my machines. My company is using it in production to backup multiple critical servers for quick recovery, while also providing inexpensive and easily-updated offsite backups.
The text was updated successfully, but these errors were encountered: