Unison: Difference between revisions

From miki
Jump to navigation Jump to search
(New page: == References == * [http://www.cis.upenn.edu/~bcpierce/unison/ Homepage] * [http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html Manual] ** [http://www.cis...)
 
(basic profile)
Line 27: Line 27:
</li>
</li>
</ul>
</ul>

== Basic Profile ==
Here a basic setup to backup pen usb stick on Cygwin:
{{hiddenSourceFile|~/.unison/|common-prefs|<pre class="common-prefs">
#Fastcheck - by default false on windows machine, and true on Unix machine.
#When true, uses modification date + file size as inode number. Otherwise do a full scan
fastcheck = true

# If any new preferences are added by Unison (e.g. 'ignore'
# preferences added via the graphical UI), then store them in the
# file 'common-prefs' rathen than in the top-level preference file
addprefsto = common-prefs

#Common ignore specification
ignore = Name System Volume Information
</pre>
}}

{{hiddenSourceFile|~/.unison/|default.prf|<pre class="default.prf">
# Unison preferences file
include common-prefs
</pre>
}}

{{hiddenSourceFile|~/.unison/|usb-pen-backup.prf|<pre class="usb-pen-backup.prf">
# Roots of the synchronization
root = /cygdrive/f
root = /cygdrive/z

# Make sure that both roots are mounted
mountpoint = .

# Common include
include common-prefs

#Fastcheck - by default false on windows machine, and true on Unix machine.
#When true, uses modification date + file size as inode number. Otherwise do a full scan
fastcheck = true

# If any new preferences are added by Unison (e.g. 'ignore'
# preferences added via the graphical UI), then store them in the
# file 'common-prefs' rathen than in the top-level preference file
addprefsto = common-prefs
</pre>
}}

Revision as of 12:36, 26 April 2010

References

Basic usage

  • Synchronize two directories
unison <dir-a> <dir-b>
  • Selecting files to synchronize
    • Synchronize home directory, using Ignore facility to skip some files.
    • Create a subdirectory called shared, and synchronize that directory only.
    • (Linux only) Create a subdirectory called shared, with symbolic links to other local directories, and synchronize that directory only using follow (making symlink transparent).
    • Synchronize home directory as root, using -path switch on the command line:
      unison /home/username ssh://remotehost//home/username -path shared
      

      The -path option can be used as many times as needed, to synchronize several files or subdirectories:

      unison /home/username ssh://remotehost//home/username \
          -path shared \
          -path pub \
          -path .netscape/bookmarks.html
      

      These -path arguments can also be put in your preference file.

Basic Profile

Here a basic setup to backup pen usb stick on Cygwin: