Copying Junctions

Discuss new features and functions
Posts: 45
Joined: 20 May 2008

arrmo

Hi,

I found a new feature of Windows Vista / 7 yesterday - junctions (or at least
it was new to me ... :-)). Is there a way to tell FFS not to try to copy (or
follow) these?

Thanks!
User avatar
Site Admin
Posts: 7062
Joined: 9 Dec 2007

Zenju

There are two (I'd call them advanced) settings in each *.ffs_batch file to
handle reparse points for directories

< TraverseDirectorySymlinks >

and for files
< CopyFileSymlinks>

Junctions and symbolic links are both special cases of reparse points, so
setting TraverseDirectorySymlinks to false (which should be the default
anyway) should do what you want.

Regards, Zenju
Posts: 45
Joined: 20 May 2008

arrmo

Does this also apply to the GUI case (i.e. are these variables also available
there)?

Thanks!
User avatar
Site Admin
Posts: 7062
Joined: 9 Dec 2007

Zenju

No, they're not on GUI. Which reminds me: I should add some description to
readme.txt as handling these options is not really intuitive.
Posts: 45
Joined: 20 May 2008

arrmo

Would it make sense to add this to the GUI, or at least in the configuration
file that can be loaded by the GUI?

Thanks!
User avatar
Site Admin
Posts: 7062
Joined: 9 Dec 2007

Zenju

For "advertising" purposes at most. Generally I consider these options as too
specific as to bother "casual" user with them. Also the default settings are
both safe and should suffice for most situations.

PS: It's both available in *.ffs_batch and *.ffs_gui, not just the first one.
Posts: 45
Joined: 20 May 2008

arrmo

OK, I tried this, and you are correct - the default is false ... but FFS still
seems to be trying to follow these links.

Am I doing something stupid (which is pretty normal for me ... :-()?
User avatar
Site Admin
Posts: 7062
Joined: 9 Dec 2007

Zenju

What is the exact directory type you're dealing with? Is it a symbolic link, a
hard link, an NTFS junction point or something else?

Could you give some description about how to reproduce this behavior?
Posts: 45
Joined: 20 May 2008

arrmo

Sorry - somehow I missed your question! Let me try to answer it now - and BTW,
I have been fiddling with settings, and still can't get this to work ... :-(.

The issue shows up if you set the source directory (for Update mode) to the
Documents folder - as there are some hidden junctions there to directories
inside AppData. I have excluded AppData itself, but the junctions (links) show
up, and fail when trying to copy the info inside AppData. These junctions show
up on the list, even though Traverse Links is off, and they look like
shortcuts.

Make sense?

Thanks!
User avatar
Site Admin
Posts: 7062
Joined: 9 Dec 2007

Zenju

The junctions themselves are not excluded. "TraverseDirectorySymlinks ==
false" only means that reparse points are not traversed. They are still shown
on the list. This also makes sense, because this means that they get copied
when synchronizing.

What exactly is now the problem? Do you have some specific step-by-step
actions to demonstrate what goes wrong?
Posts: 45
Joined: 20 May 2008

arrmo

The issue is that not only are these shortcuts copied (that would be fine!),
but it also tries to enter these directories - which it shouldn't with
simlinks off ... should it?

The way to duplicate it is to synchronize (actually, update, 1 way copy) a
user's Documents folder (\Users\username\Documents) to any other directory ...
make sense?

Anonymous

I have a small issue of similar vein.
Setup: Win7 32-bit client syncs into a network share in batch mode.
TraverseDirectorySymlinks: false
CopyFileSymlinks: true
Left: C:\Users\xxx\Documents
Right: Z:\xxx\Documents

In Windows 7 the "My Pictures", "My Music" and "My Videos" have moved out of
"Documents" folder, but the "Documents" folder contain the links to a new
location.
The problem: FreeFileSync produces the following error in log file when
syncing Documents folder:
Info: Creating folder
"Z:\xxx\Documents\My Pictures"
Error: Error creating directory:
"Z:\xxx\Documents\My Pictures"
Windows Error Code 5: Access is denied.
...
Warning: Synchronization completed with errors!

The error goes away, when I create these directories on the share manually.
These remain empty after syncing.

Manually creating empty directories is a viable workaround, but is there a way
to avoid this error altogether?

Anyway, great program and big thanks for this!
User avatar
Site Admin
Posts: 7062
Joined: 9 Dec 2007

Zenju

Okay, I see the problem: The folders contained in C:\Users\<name>\My Documents
are NOT symbolic links but junctions.
Without changing permissions it's not even possible to enter them via the
explorer.

AFAICS it doesn't make sense to synchronize these junctions as they don't
contain any data. Accessing them is not possible without changing permissions
externally.

So I'm not sure what FFS is supposed to do. Do we have a problem at all? ;)

> way to avoid this error altogether?

simplest thing would be to use an exclude filter
Posts: 45
Joined: 20 May 2008

arrmo

Yep - these are exactly the ones I was talking about originally - glad I
wasn't crazy at least ... :-).

Perhaps an option to ignore them / junctions (or not)?

Thanks!

Anonymous

> So I'm not sure what FFS is supposed to do.

If the TraverseDirectorySymlinks: false, then FFS shouldn't try to copy these.
And also shouldn't get an error.

If the TraverseDirectorySymlinks: true, then FFS should try to copy or get an
error, whetever happens :).

You are right, exclude filter is a better workaround.
User avatar
Site Admin
Posts: 7062
Joined: 9 Dec 2007

Zenju

>If the TraverseDirectorySymlinks: false, then FFS shouldn't try to copy these

I'd prefer to keep semantics for all reparse points (including junctions and
symbolic links) the same: For symbolic links
"TraverseDirectorySymlinks==false" means: copy the link. "true" means create
regular directory with same name. The reasoning is that "traversing" is
logically conjugated to "link copying".

I've tested behaviour with NTFS junctions in Windows Seven and it is the same
as for symbolic links. At least the program behavior is consistent in this
regard. The "real" problem is that users by default lack permissions to copy
copy/traverse junctions. But I don't see this as a problem of FFS.

Anonymous

Your reasoning is sound, the workaround is found :).
Posts: 1
Joined: 21 Feb 2010

ukadamr

I've just upgraded from Windows XP64 to 7 and am now having this (I'm syncing
my user profile too).

I see that TraverseDirectorySymlinks is already false in my "User.ffs_gui"
file, however I get 11 errors for the 11 junctions in my user profile. What
filter did you end up adding to your exclude, or must I add all 11 of them
separately?

Oh btw nice program :) It's replacing Second Copy here.
User avatar
Site Admin
Posts: 7062
Joined: 9 Dec 2007

Zenju

@ukadamr: Currently I see 4 solutions to this problem:

1. Set permissions for all junctions appropriately to allow copying them: Tedious, doesn't offer any real benefit, as the target directories the junctions point to, are included in the sync anyway, and the junctions themselves don't contain any data.

2. Exclude all junction paths with a filter (If you have 11 junctions this requires 11 exclude filter entries). Some initial work, but at least it has to be done just once.

3. When comparing click on "ignore" errors and check "don't show subsequent"... Needs to be done for each comparison, probably cumbersome.

4. Use multiple folder pairs and don't sync the whole USER directory, but just the sub-directories you really need. (This can also be achieved by using an include filter that includes all required directories and using a single folder pair only.)

I'd probably go for 4.) or 2.)

Regards, Zenju