Re: Synchronization pb : ntfs <--> vfat <--> ext4

Greg Troxel <[email protected]> Fri, 20 Sep 2024 08:18:25 -0400
Newsgroups gmane.network.unison.general
Message-ID <[email protected]>
Cyrille DEUSS <[email protected]> writes:

> I use an USB stick in the middle to synchronize the following way :
> many ntfs <--> my vfat <--> only one ext4.

For background, I don't use Windows and I use FAT only when I can't
avoid it, and I don't use it with unison at all.

> Sometimes Unison doesn't recognize that some files have changed
> between mys USB stick and my ext4.

If you want to make progress on that I would suggest creating a script
to reproduce the situation.  Generally, sync programs assume no change
if mod time and size are unchanged, to avoid hashing again; see the
"Fast Update Detection" section of the manual and the fastcheck
preference.

It's possible that fastcheck should default to off when there aren't
timestamps, and that this could be improved.

> Moreover, when copying from vfat to ntfs some files are copied with
> hidden and/or archive attributes despite the "fat = true" line in my
> prf. How to avoid that ?

I don't deal with FAT, so I have no idea.  Looking at the man page:

     fat     When this is set to true, Unison will use appropriate options to
             synchronize efficiently and without error a replica located on a
             FAT filesystem on a non-Windows machine: do not synchronize
             permissions (perms = 0); never use chmod (dontchmod = true);
             treat filenames as case insensitive (ignorecase = true); do not
             attempt to synchronize symbolic links (links = false); ignore
             inode number changes when detecting updates (ignoreinodenumbers =
             true). Any of these change can be overridden by explicitly
             setting the corresponding preference in the profile.

This doesn't say that attributes aren't synced.  The fat option is
basically working around deficiencies in FAT compared to UNIX norms (no
permissions, no modes, case insensitivity, lack of symlinks).  There are
attribute options listed in the manual.

It's also possible that the fat option should somehow be per replica not
per sync, but I personally am going to defer thinking about that until I
need to use unison with FAT.

> Last but not least, is there a way on Windows to set $HOME=mypath
> before starting unison ? I've read the manual but haven't been able to
> make something of it.

That's a windows question not a unison question.  In the Unix world it's
straightforward (not tested, and of course you should never have spaces
in filenames, and if so you'll have to learn about shell quoting :-):

  #!/bin/sh
  export HOME=mypath
  unison $*  # or "$@"

There are a vast number of things one might want to configure before
running unison, and because those aren't really about unison, and can
easily be set before, unison doesn't have features to deal with them
(and is unlikely to merge any such features).

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].