gilbertchen / duplicacy

A new generation cloud backup tool
https://duplicacy.com
Other
5.07k stars 332 forks source link

Symlink behaviour #156

Open niknah opened 6 years ago

niknah commented 6 years ago

I noticed that if I have a symlink that goes to the same folder, it doesn't always gets copied as a symlink...

ln -s ../../../tmp/xxx reflink (gets backed up as a symlink) ln -s /tmp/xxx rootlink (the whole folder gets backed up)

In other software I've used, it's either always copy symlink or always follow symlinks.

If anyone else wants to copy the symlink only always, you can do it by commenting out this in duplicacy_entry.go...

else if path == "" && filepath.IsAbs(entry.Link) && !strings.HasPrefix(entry.Link, normalizedTop) { ... }

level323 commented 6 years ago

@niknah: Thankyou for noticing this. At very least this behaviour needs to be documented, but I'm struggling to find a common use case for this behaviour and so I would suggest the behaviour be changed so that symlinks always get backed up as symlinks.

The only exception to this rule involves the existing facility to relocate .duplicacy directories. In this case, symlinks at the same level as the .duplicacy directory should still be traversed by duplicacy (effectively providing a facility to explicitly include directories for backup via symlink).

TheBestPessimist commented 6 years ago

@level323 what you're saying is somewhat incorrect: I (and also others) would like to be able to move the .duplicacy folder to someplace else (for example have a folder with all the configs, and give the path to each .duplicacy folder as needed for backup.

I think that what you want is actually for duplicacy to always and only follow the symlinks in the root of the repository.

Is my opinion correct?

level323 commented 6 years ago

@TheBestPessimist I thought that was what I was saying, but it seems possible I didn't describe it well/accurately.

In any case, we are of the same view.

TheBestPessimist commented 6 years ago

In this case, symlinks at the same level as the .duplicacy directory should still be traversed by duplicacy

That made me (not?) understand it.

gilbertchen commented 6 years ago

Can you double check? There aren't any intended changes regarding symlinks.

niknah commented 6 years ago

Sorrry, it's working. The file wasn't mentioned in -d -stats, removed my comment

TheBestPessimist commented 5 years ago

May we close this?

niknah commented 5 years ago

If it has been documented so people know how symlinks are followed.

TheBestPessimist commented 5 years ago

Noted here: https://forum.duplicacy.com/t/move-duplicacy-folder-use-symlink-repository/1097, but I will also create a new explicit topic about symlink behavior.