6

The program rsync has the option --max-size=SIZE to prohibit transferring any file larger than SIZE. Does unison have a similar option?

Ole Tange
  • 5,099

3 Answers3

7

You could use the -copythreshold option. From the unison help flag:

-copythreshold n   use copyprog on files bigger than this (if >=0, in Kb)

You could make a dummy program/script that does nothing. Usually I believe that you would specify rsync with special options as the copyprog, but if you don't want to copy anything, the copyprog should take no action.

Gareth
  • 19,080
Liam M.
  • 71
2
# ~/.unison/myprofile.prf

# Skip files larger than 200 megabytes

# Use copyprog with files larger than XXX Kb
copythreshold = 200000

# rsync will skip files that are too large
copyprog      =   rsync --inplace --compress ""--max-size=200M""
copyprogrest  =   rsync --partial --inplace --compress ""--max-size=200M""

Copied from the Unison Wiki.

1

See also maxsizethreshold parameter for precisely this. Either set in the prf project file or as a command line option, eg for 100Kb

unison project -maxsizethreshold 100