Unison: Difference between revisions
Jump to navigation
Jump to search
Line 40: | Line 40: | ||
Here a basic setup to backup pen usb stick on Cygwin: |
Here a basic setup to backup pen usb stick on Cygwin: |
||
{{hiddenSourceFile|~/.unison/|default.prf|< |
{{hiddenSourceFile|~/.unison/|default.prf|content=<source lang=bash class="default.prf"> |
||
# Unison default preferences file |
# Unison default preferences file |
||
Line 60: | Line 60: | ||
# Common Ignore specification |
# Common Ignore specification |
||
ignore = Name System Volume Information |
ignore = Name System Volume Information |
||
</ |
</source> |
||
}} |
}} |
||
{{hiddenSourceFile|~/.unison/|usb-pen-backup.prf|< |
{{hiddenSourceFile|~/.unison/|usb-pen-backup.prf|content=<source lang=bash class="usb-pen-backup.prf"> |
||
# Roots of the synchronization |
# Roots of the synchronization |
||
root = /cygdrive/f |
root = /cygdrive/f |
||
Line 70: | Line 70: | ||
# Common include |
# Common include |
||
include default.prf |
include default.prf |
||
</ |
</source> |
||
}} |
}} |
Revision as of 09:37, 6 August 2014
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.
Configuration tips
- On Samba / CIFS file system, ignore permissions:
perms = 0
Basic Profile
Here we assume that all profiles will include the default one. If not, a more complex solution is to create a file .unison/common-prefs, that would be included by all profiles, including the default one.
Here a basic setup to backup pen usb stick on Cygwin:
~/.unison/default.prf (<file name="default.prf" tag="source">download</file>)
# Unison default preferences file
# Fastcheck - by default false on windows machine, and true on Unix machine.
# When true, uses modification date + file size as inone 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
# default profile file
addprefsto = default.prf
# Ignore file permissions (necessary on samba/CIFS fs)
perms = 0
# Make sure that both roots are mounted
mountpoint = .
# Common Ignore specification
ignore = Name System Volume Information
~/.unison/usb-pen-backup.prf (<file name="usb-pen-backup.prf" tag="source">download</file>)
# Roots of the synchronization
root = /cygdrive/f
root = /cygdrive/z
# Common include
include default.prf