Errors Copying and Pasting Files/Folders

Please see attached SYNCTRAZOR.pdf (645.0 KB) PDF with questions.

I assume that my issues may have something to do with my stignore file settings, but I am not sure why.

It’s not the cause of the sync issue(s), but your ignore patterns does have one potential problem (unless it was intentional). The last regex pattern is written as:

\PC\Trimble SCS900 Data\_Archive

The directory separator is a forward-slash (/) instead of a backslash (), while the backslash is an escape character.

So the regex above is actually saying, “Ignore any file with the name 'PCTrimble SCS900 Data_Archive`” (“P”, “T” and “_” aren’t special characters so it’s as if the backslash doesn’t exist).

image

Looks like a problem on the operating system side. Check the permissions on the folder (e.g., is Syncthing running under the same user as the owner of the folder?).

On the mobile devices, it’s often helpful to enable “Ignore Permissions” because many file attributes from desktop filesystems often don’t apply to iOS and Android.

So the following ignore patterns are from one of the screenshots in your PDF for device “Lenovo-PC”:

allsites.xml
site.xml
**Tasklog.txt
**.elg
\PC\Trimble SCS900 Data\_Archive

If any files matching the ignore patterns above end up being the last file(s) in a directory on another device, when you delete the directory on “Lenovo-PC”, the matching directory on the other devices might not be deleted, resulting in the sync process never reaching 100%. This is because you’re ignoring those files – i.e., never received them from the other devices – so the other devices will continue to hold them even if you delete the directory on “Lenovo-PC”.

From the “Ignoring Files” page:

Note that ignored files can block removal of an otherwise empty directory. See below for the (?d) prefix to allow deletion of ignored files.

That’s only true on non-Windows. In Windows, you can use \ in ignore patterns literally as the path separator. That’s also why you can’t escape characters in ignore patterns in Windows too. In other words, \PC\Trimble SCS900 Data\_Archive is fine in this case (except for the access denied problem, of course).

The backslash did work, because that is what I did to temporarily fix the problem. I will try the (?d) prefix and see how that works. Although I am not 100% sure where to put that in the file.

You just need to add it at the beginning of each ignore pattern, e.g.

(?d)allsites.xml
(?d)site.xml
(?d)Tasklog.txt
(?d)*.elg
(?d)\PC\Trimble SCS900 Data\_Archive

(Also removed a few superfluous * from the patterns).

Thanks alot!

im still having issues, even after editing the code with the (?d) characters… it doesnt seem to have anything to do with the ignore files. i tried to cut and paste a folder to another folder, and it will work fine on the initial computer, but the other devices refuse to delete the original folder, just keeping the folders there with nothing in them.

Check the folder permissions – including the permissions of the parent folder – on the other devices. Syncthing might not have permission to remove them.

Since the source computer is Windows, if the other devices are non-Windows, enabling “Ignore Permissions” is a good idea.

the other devices are all windows. i am not sure i understand the folder permissions. do i change the permissions to full control? And do i have to do this on all the devices that are synced? i am also not sure what to do about the read-only option in the folder. 2022-12-06 07_53_36-Data2 (D_) 2022-12-06 07_53_24-Data2 (D_)

No, no. “Ignore Permissions” is a Syncthing setting.

(Note that according to the PDF you posted earlier, the other devices didn’t appear to be all Windows. One had the device label “Matts IPAD”.)

Since you said that the problem is the other devices are leaving empty folders, you’ll need to check the file and folder permissions on every device that is having the problem.

Either the folders aren’t truly empty (hidden files), or for some reason the user Syncthing is running as doesn’t have enough permissions to remove the empty folders.

It’s okay to ignore the “Read-only” checkbox. It’s baggage carried over from older versions of Windows. It’s the “Security” tab under the file/folder properties (as shown in your screenshots) that’s important.

File and folder security in Windows is complicated, so it’s best to check microsoft.com if you need help with understanding how to interpret what’s shown in the sample screenshots (this post would be several pages long and require lots of pictures to scratch the surface of Windows file/folder permissions). The short version is that you generally need to have “Full control” of a folder to delete it.

If a user on another device is not the same person, e.g., “Andy” on device “A” is syncing files with “Bob” on device “B”, you’re better off turning on the Ignore Permissions setting in Syncthing (under the Advanced tab). That’s because if you try to sync permissions and possibly extended attributes across, “Bob” won’t necessarily have enough permissions to change files that are owned by “Andy”.

Take a look at the AccessChk and AccessEnum utilities from Microsoft’s Sysinternals website.

However, if you find it too complicated to sort out the file/folder permissions, one simple way to bulk fix the problem:

  1. Temporarily pause the Syncthing folder on all devices.
  2. On every device that’s syncing the Windows folder, enable “Ignore Permissions” for that Syncthing folder.
  3. Temporarily move the original D:\Trimble Synchronizer Data Windows folder on Lenovo-PC onto an external drive that is formatted as VFAT or exFAT – do not use NTFS.
  4. Once the transfer is complete, there should be no Trimble Synchronizer Data Windows folder in D:\ on Lenovo-PC.
  5. Delete the Windows folder off every device (don’t simply delete the contents) and replace it with an empty folder.
  6. On Lenovo-PC, move the Trimble Synchronizer Data folder from the external drive back onto D:\.
  7. Unpause the Syncthing folder on all devices.

So, why go to all the trouble above?

FAT/VFAT/exFAT do not support user level file and folder attributes. Moving the files from the NTFS-formatted D: drive onto a FAT/VFAT/exFAT has the effect of “washing” the permissions settings.

The files will be owned by whoever copies them back onto Lenovo-PC. Then with Ignore Permissions enabled on the other devices, whoever is running Syncthing will own the files and folders.

Wow, that was a lot to take in. I am thinking that I may be making this more complicated than it is. Is there anyway I can get in touch with someone on the phone to maybe go over our specific application, and possibly be able to streamline the setup. I made a pdf that attempts to describe our situation. SYNCTRAZOR_HELP.pdf (1.7 MB)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.