Syncronize your Files with Unison

See also the alternative software FreeFileSync.

Unison is a file-synchronization tool for Linux, Mac and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.

For example, you can synchronize (in both directions) your working directory on your laptop with the working directory on the D-MATH file server.

What you need is following…

  • your ssh key
  • unison

SSH Keys

Open a Terminal (Mac: Applications > Utilities > Terminal) and enter the following commands:

mv ~/.ssh ~/.ssh-old
scp -pr <username>@sftpmath.math.ethz.ch:home/.ssh ~/.

For Mac OS X

Please use FreeFileSync instead.

For Linux

Unison is usually already installed on our Linux systems and has to be configured as follow. Create a file in the directory ~/.unison/ called for instance MATH.prf with following content:

# the roots to synchronise:
root = /path/to/your/home
root = ssh://username@sftpmath.math.ethz.ch/home

# some useful options
times = true
servercmd = unison-2.40

# Files to ignore
ignore = Regex ^\...*
ignore = Name VIDEO_TS
ignore = Name AUDIO_TS
ignore = Name *.mp4
ignore = Name *.mp3
ignore = Regex ^Downloads
ignore = Regex ^Music
ignore = Regex ^Pictures
ignore = Regex ^Public
ignore = Regex ^Videos

In the first “root”-line enter the output of the following command:

cd && pwd

In the second “root”-line replace “username” with you ETH username.

Author

Posted on
in Backup

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

PROTECT YOUR BRAINWORK.

Recent Posts

Trending

Categories

Recent Posts