Open vgivanovic opened 3 years ago
Thank you for testing and auditing nFreezer @vgivanovic, this is helpful!
I'll try this too. In your opinion, what should be the expected behaviour when a symlink is unresolved? Skip (with a precise logging) or stop the whole process?
You bring up a good question: How should NFreezer deal with symbolic links? Does it follow the link? What about dangling links? Or any link which generates an error (e.g. a link which points to a file that is inaccessible to the current user).
Right now, if NFreezer skips the link, a restore will not restore the original directory tree. On the other hand, not skipping means that NFreezer can never backup beyond the first dangling symbolic link.
So, I suggest that NFreezer skip the dangling link but make a note of it. I also suggest that NFreezer follow the Unix philosophy of being silent unless a error occurs or the use specifically asks for verbose output. That way the errors stand out. Both cp and rsync generate a non-fatal error when dealing with a dangling symbolic link, but can be told to copy the link nonetheless.
I'd copy exactly what one or the other of cp or rsync does or can do and note the behavior in the documentation. BTW do non-fatal errors get written to stderr?
— Vladimir
Vladimir G. Ivanović email vladimir@acm.org mailto:vladimir@acm.org mobile +1 650 450 4101
On 28/11/2020 10.23, josephernest wrote:
Thank you for testing and auditing nFreezer @vgivanovic https://github.com/vgivanovic, this is helpful!
I'll try this too. In your opinion, what should be the expected behaviour when a symlink is unresolved? Skip (with a precise logging) or stop the whole process?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/josephernest/nfreezer/issues/3#issuecomment-735272794, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJM242TE2ORN7PYA3PXXTSSE52TANCNFSM4UF566EQ.
I chose to test NFreezer on my collection of source files pulled (mostly) from GitHub. A lot of them have dangling symlinks which NFreezer doesn't like:
Restarting NFreezer doesn't help; it fails again at the same place.