bcpierce00 / unison

Unison file synchronizer
GNU General Public License v3.0
4.11k stars 232 forks source link

Syncing two USB-Sticks not working out on Win11 #893

Closed mircsicz closed 1 year ago

mircsicz commented 1 year ago

Hi all, just installed latest from chocolatey and worked out a profile:

# Unison preferences file
root=D:\
root=E:\
force=D:\

# dirs
path=_Apps
path=_OSs
# files
path={*.iso}
path=*.pdf

ignore=Name temp.*
ignore=Name ._*
ignore=Name .*~
ignore=Name *.tmp
ignore=Name *.swp
ignore=Path .fseventsd
ignore=Path System Volume Information
ignore=Path .Spotlight-V100
ignore=Path .TemporaryItems
ignore=Path .Trashes

log = true
times = true
auto = true

While calling it I get the following feedback:

C:\Users\mircsicz>unison 128to256
Unison 2.53.2 (ocaml 4.14.0): Contacting server...
Looking for changes
Reconciling changes

D:/            E:/
         error            *.pdf
The filename *.pdf in path *.pdf is not allowed under Windows
         error            {*.iso}
The filename {*.iso} in path {*.iso} is not allowed under Windows
new dir  ---->            _OSs

Proceed with propagating updates? []
No default command [type '?' or F1 for help]
Proceed with propagating updates? [] y
Propagating updates

Unison 2.53.2 (ocaml 4.14.0) started propagating changes at 04:09:24.06 on 03 Apr 2023
[ERROR] Skipping *.pdf
  The filename *.pdf in path *.pdf is not allowed under Windows
[ERROR] Skipping {*.iso}
  The filename {*.iso} in path {*.iso} is not allowed under Windows

I've googled all over the place for "The filename in path is not allowed under Windows" can't find it mentioned in any documentation...

Hoping for a hint on how to sync two USB-Stick on Windows or more specifically how to define a path var to sync a specific file type. Also hope there's a better solution than just calling the drive letter, I'ld love to be able to use something more unique like the Name of the Filesystem-Label ;-)

tleedjarv commented 1 year ago
path={*.iso}
path=*.pdf

The path preference will not take file names (globbed or not). (And the error you're seeing is about treating * as a literal file name.)

Also hope there's a better solution than just calling the drive letter, I'ld love to be able to use something more unique like the Name of the Filesystem-Label ;-)

Have a look at #588 and the \\?\Volume{GUID}\ form mentioned there, maybe that helps. Unison should now support all different Windows path forms, so if you can find a path other than drive letter that works in Windows then you can try that with Unison.

mircsicz commented 1 year ago

How can I sync those files being directly in the root folder? I'm syncing two Ventoy USB-Sticks, so the main data are those ISOs in the rootfolder...

Just discovered #588 15 Min's ago. But have yet to figure out how to test it...

tleedjarv commented 1 year ago

Try asking for help in the mailing list. Since you are not reporting a bug, the ticket here will be closed. https://github.com/bcpierce00/unison/wiki/Reporting-Bugs-and-Feature-Requests#asking-for-help-and-the-issue-tracker

Hint: you can combine ignore and ignorenot preferences, as the latter will override the former.

mircsicz commented 1 year ago

For me there's a bug or at least a flaw in the doc's as my above mentioned failure message isn't listed in the docs...

tleedjarv commented 1 year ago

For me there's a bug or at least a flaw in the doc's as my above mentioned failure message isn't listed in the docs...

That's fair and you can reopen with appropriate title or open a new ticket explaining the specific deficiencies in documentation. Documentation fixes and improvements are always welcome. Also, don't shy away from opening a PR suggesting direct changes.

mircsicz commented 1 year ago

I've written tex and once I've figured a way to sync my two Sticks I might come up with an example to add to the Windows Chapter of the manuel ;-)

mircsicz commented 1 year ago

Added a little example config to my post in 588