特殊:Badtitle/NS100:Unison

来自Ubuntu中文
Wikibot留言 | 贡献2007年12月4日 (二) 11:31的版本
跳到导航跳到搜索
可打印版本不再受到支持且可能有渲染错误。请更新您的浏览器书签并改用浏览器默认打印功能。

{{#ifexist: :Unison/zh | | {{#ifexist: Unison/zh | | {{#ifeq: {{#titleparts:Unison|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Unison|1|-1|}} | zh | | }}

About

From the Unison website: Unison is a file-synchronization tool for Unix 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.

Installation

Unison can be found in Ubuntu's Universe software repository, in the unison package. See InstallingSoftware for information about installing software, and UbuntuHelp:Repositories if you need help enabling Universe. In order to use Unison with Ubuntu and Microsoft Windows, you will need to have Samba installed and setup. For instructions on setting up Samba in Ubuntu, visit the SettingUpSamba wiki page.

GUI Configuration

Unison uses Profiles, this refers to the two root (directories) that are to be synchronized. On starting Unison via the Applications menu you will be presented with a window that allows you to select an existing profile or create a new one. On selecting Create New Profile you will be asked to enter a profile name, such as "USB Stick". Once named the profile can be selected. As the profile is new Unison will guide you though the steps of setting the roots. The first root should be a local directory for example /home/[Username]/work/. The second root can be local or on a target machine. Unison allows synchronization to be carried out over a network using SHH (Further information at UbuntuHelp:SSHHowto), RSH or a specific port on the target machine. Notice the Help button, this gives more information on setting up of remote access. Once this is complete Unison will scan the two locations and show the differences.

Command Line usage

Unison can be invoked from the command line. This makes it a useful program for writing backup scripts that clone two directories. The following is a simple example to synchronize a music directory between two PC's.

unison /home/[Username]/MyMusic /location_of_samba_directory

Or if a profile has been created.

unison "USB Stick"

Notice you do not need to specify a path, Unison searches in /home/[Username]/.unison/ for a corresponding profile. Depending on the size of the directories and the amount of files, a good amount of time may be needed. Unison can be setup to run on a schedule. This can be done by utilizing the "cron" scheduler. Further information regarding cron can be found at the CronHowto wiki page.

Further Help

Included in Unison is a great help section, it can be found via the GUI under Help. Its topics include the different interfaces, the basic concepts and ways of running Unison. I would highly recommend reading this for more detailed information. Unison has many command line options available, for more information type

man unison

or

unison --help