6

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

Mike Pierce
  • 392
  • 2
  • 17
Ole Tange
  • 4,529
  • 2
  • 34
  • 51

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.

Gaff
  • 18,569
  • 15
  • 57
  • 68
Liam M.
  • 71
  • 1
  • 2
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.

Kamil Slowikowski
  • 431
  • 1
  • 3
  • 10
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