-
Notifications
You must be signed in to change notification settings - Fork 32
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
Improve handling of dangling symlinks when creating file list #27
Comments
Just wanted to say that I got something working in a slightly different setup:
I was successfully able to rsync the contents of a Docker named volume (even while a container was running/attached to it) 👌 -- That's backup done. Now for restore 😅 |
My plan was to (btw):
|
Hey! The problem you ran into is that you were trying to serve Obviously the current behavior of You can work around the issue by changing the code to ignore --- i/rsyncd/flist.go
+++ w/rsyncd/flist.go
@@ -45,6 +45,12 @@ func (st *sendTransfer) sendFileList(mod Module, opts *Opts, paths []string) (*f
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
// st.logger.Printf("filepath.WalkFn(path=%s)", path)
if err != nil {
+ if os.IsNotExist(err) {
+ // We encounter -ENOENT when walking over a dangling symlink
+ // (e.g. /proc/<pid>/fd/3). Don’t stop file list creation,
+ // just ignore the affected file.
+ return nil
+ }
return err
} |
@stapelberg Oh! 🤦♂️ This is because despite the |
Hey @stapelberg 👋
Toying around with your tool/library here and ran into a small problem I'm a bit befuddled by:
(I'm trying to see if I can build a container backup solution using rsync as the primary driver)
I'm an invoking an
rsync(1)
client invoking thegokr-rsync
over a shell like so:I'm not sure why /proc/1/fd/3 is being opened? I poked around in the container that is spawned and there is no file descriptor
3
, only0 1 2
as you'd expect (stdin, stdout, stderr).My
Dockerfile
is mostly similar to yours:And the
entrypoint.sh
:The text was updated successfully, but these errors were encountered: