Use Unison when you need two Ubuntu directories to stay synchronized in both directions—for example, a working folder and a second disk or an SSH-accessible server. Install the Ubuntu unison package, create a profile in ~/.unison, protect removable destinations with mountpoint, review the first run interactively, and enable versioned backups when you need rollback. Unison is a synchronization tool, not an inherently one-way or immutable backup system, so a safe design normally combines a separate replica with tested restore copies.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
What Unison protects—and what it does not
Unison maintains two replicas of a directory and reconciles changes made independently on either side. The replicas can be two paths on one Ubuntu computer, two locally attached disks, or a local path and a directory on another host reached over SSH. That bidirectional behavior is Unison’s defining strength: it can detect and resolve changes on both replicas instead of assuming that one side is always the source.
As an Amazon Associate I earn from qualifying purchases.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteIt is not automatically a one-way, append-only backup program. If you delete a file in one replica and allow that change to be propagated, the file can disappear from the other replica too. A second synchronized disk therefore helps with disk failure but does not by itself provide protection from every accidental deletion, ransomware event, or unwanted change. Use Unison’s versioned backup preferences when you need rollback copies, and keep those copies on storage with adequate capacity and permissions.
The practical design is:
- Replica 1: the directory you actively use.
- Replica 2: a separate disk or remote host that Unison keeps in sync.
- Rollback storage: optional Unison backup versions retained independently of the live replica.
Ubuntu’s backup guidance recommends storing copies separately from the computer, such as on an external hard disk. Physical separation is useful because a failed internal disk, theft, or an incident affecting the computer should not automatically affect every copy.
#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Choose the destination before installing
Local second disk
A local destination is usually the simplest and fastest arrangement. Give the destination a stable mount point, such as /media/alice/backup, and create a dedicated directory below it. The destination must have enough free space for the current source and any retained Unison versions. If the source contains files whose ownership, modes, or timestamps matter, use a Linux-compatible filesystem rather than a filesystem with limited Unix metadata support.
Remote Ubuntu host over SSH
A remote host keeps the second copy away from the source computer. The remote account needs read access to the source-side data as presented by Unison and write access to the destination directory. Plan for network interruptions, matching Unison versions, account authentication, and sufficient remote capacity before the initial transfer.
Capacity and separation checks
- Reserve space for the source tree, growth, and any retained versions configured with
maxbackups. - Keep rollback storage separate from the live synchronized directory when accidental changes are a concern.
- Place a removable drive somewhere physically separate from the computer when practical.
- Decide which caches, build products, and other reproducible data do not belong in the backup.
Install Unison from Ubuntu
Ubuntu distributes Unison in the Universe repository. The Ubuntu package index lists 2.53-series packages for Noble 24.04 LTS and newer suites in its 2026 listing. Install the package with the normal package manager:
sudo apt update
sudo apt install unison
Check the installed client before configuring a large job:
unison -version
For an SSH arrangement, install a compatible Unison version on both endpoints. A client and server that cannot agree on a compatible protocol or archive format will stop before synchronization. Use the Ubuntu package and manpage for the release on each host as the authority for the version shipped there; do not assume that two distributions’ package names imply identical versions.
Prepare and verify a local destination
Do these checks before the first full scan. They catch the most dangerous failure mode with removable storage: an unmounted path that looks like an empty ordinary directory.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problems- Mount the destination. Attach the drive and mount it at the path you intend to use.
- Confirm the mount. Run
findmnt /media/$USER/backup(replace the path with your actual mount point) and verify that the expected device and filesystem are shown. - Check capacity. Run
df -h /media/$USER/backupfor byte capacity anddf -i /media/$USER/backupfor inode availability. A disk can have free bytes but no inodes for new files. - Check access. Verify that your account can create, read, rename, and remove a test file in the destination directory.
- Inspect the source. Confirm the source path and ownership before allowing any deletion or update.
For a FAT32 or VFAT USB device, Ubuntu’s Unison guide warns that file-permission limitations can cause problems. Prefer a filesystem that represents the source metadata correctly. If the destination cannot represent those permissions and that loss is acceptable, set perms = 0 in the profile; understand that this changes what metadata can be preserved.
Run a first synchronization interactively
The basic local form documented by Ubuntu is:
unison /home/$USER/data /media/$USER/backup/data
Run this manually before using a profile or automation. Unison scans both roots, compares its archive and fingerprints, and presents proposed creates, updates, and deletions. Read the direction of every deletion and update. A first run can be large and may take considerable time while metadata and file contents are examined.
Use a small, disposable test before committing the entire tree:
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
- Create a uniquely named test file in the source.
- Run Unison interactively and verify that the file is proposed for creation at the destination.
- Open the destination copy and confirm its contents.
- Make a controlled edit on one side, run Unison again, and check that the update direction is what you expect.
- Delete the test file only after confirming which side will receive the deletion.
Keep confirmbigdel enabled while learning the workflow. Current Ubuntu manpage documentation says it is enabled by default and prompts before whole-replica or path deletions. Do not use batch mode until interactive runs have shown that the roots, exclusions, permissions, and deletion behavior are correct.
Free tools Windows power users keep installed
One-click scans. No signup required.
Create a reusable profile for a large tree
Profiles make roots, exclusions, transport, performance settings, and safety preferences repeatable. Store a named profile in ~/.unison/. This example uses two local roots:
# ~/.unison/large-data.prf
root = /home/alice/data
root = /media/alice/backup/data
path = Documents
path = Photos
ignore = Name *.tmp
ignore = Name .cache
confirmbigdel = true
perms = 0
rsync = true
stream = true
maxthreads = 4
log = true
Start it with:
unison large-data
Roots and paths
Each root identifies one complete replica. Keep both paths unambiguous and avoid pointing a root at a parent directory that accidentally contains unrelated data. The optional path lines restrict synchronization to named subpaths. If you intend to protect the entire tree, omit those restrictions rather than assuming that an omitted path means a different selection.
Exclusions
ignore = Name *.tmp and ignore = Name .cache exclude matching names wherever they occur according to Unison’s pattern rules. Add build outputs, downloaded caches, and other reproducible material only when you are certain it can be regenerated. Keep exclusions in the profile so every manual and scheduled run uses the same policy.
Permissions
perms = 0 tells Unison not to try to preserve Unix permission bits. Use it only when the destination filesystem cannot represent the source permissions or when that metadata is deliberately unimportant. On Linux filesystems that support normal ownership and modes, leaving permission handling enabled generally preserves more information.
Logging and confirmation
log = true enables logging. Keep confirmbigdel = true until you have verified the job repeatedly. A profile is a configuration record, not a substitute for checking that the destination is mounted and writable.
Prevent an unmounted USB drive from receiving a local copy
If /media/alice/backup is not mounted, Ubuntu can still expose that directory on the root filesystem. Without a guard, Unison may create a seemingly successful copy there, consuming space on the system disk while the real USB drive remains disconnected.
Use the Unison mountpoint preference for the removable destination. Set it to a path that exists only when the intended filesystem is mounted, for example:
root = /home/alice/data
root = /media/alice/backup/data
mountpoint = /media/alice/backup
When the mount point is absent or is not the expected mounted filesystem, Unison should abort instead of treating an ordinary empty directory as the destination. Test the protection deliberately: unmount the drive, run the profile, and confirm that the job stops. Then remount it and verify that findmnt reports the expected device before running again.
Recommended Free Tools
Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Use SSH for a remote backup replica
Replace the local destination root with an SSH root in the profile:
root = /home/alice/data
root = ssh://backup.example:/srv/backup/alice-data
The remote account must be able to read the source-side data as required by the synchronization and write to /srv/backup/alice-data. Confirm SSH login independently, check the remote directory’s ownership and free space, and install compatible Unison versions on both hosts.
A remote run still has bidirectional semantics. If both replicas change between runs, Unison presents conflicts rather than blindly assuming that the newest timestamp is always correct. Review those proposals interactively, especially when two people or processes can edit the same files.
For a low-bandwidth connection, start with conservative concurrency and observe transfer behavior. A remote server that is available only intermittently should not be scheduled in a way that launches overlapping runs or treats a temporary network failure as a reason to remove local data.
Tune Unison for large directories
Delta transfer with rsync = true
Unison’s transfer protocol uses rsync-like compression and delta transfer for small changes in large files. When only portions of a large file change, this can avoid sending the entire file again. Leave rsync = true enabled unless a documented compatibility problem requires a different setting.
Concurrency with maxthreads
maxthreads controls how many transfers can be worked on concurrently. More threads are not always faster: a fast local SSD and a high-capacity network may benefit from concurrency, while a slow disk, a busy CPU, or a constrained link can become the bottleneck. The Ubuntu manpage describes the default as intended for high concurrency and notes that low-bandwidth links may benefit from a value such as 1. The example profile uses 4 as a starting point, not a universal optimum.
Adjust it after observing the actual workload:
- Lower it when the link is saturated, latency is high, or the remote system becomes unresponsive.
- Raise it cautiously when many independent files are waiting and both storage and network capacity remain unused.
- Keep it modest for a USB disk that already struggles with random metadata operations.
Streaming with stream = true
stream = true can improve transfers when endpoint and network characteristics favor streaming file contents. Test it with representative files and retain it only when it behaves well with both endpoints.
Failure tolerance with maxerrors
The documented default for maxerrors is 1. Increasing it can allow most of a directory to transfer despite a small number of failures, but an excessively high value can postpone detection of a repeated problem such as a full destination disk. Raise it only when you have a clear operational reason and a log review process.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Do not delete Unison’s state casually
Unison maintains archive and fingerprint files under ~/.unison. The Noble manpage notes that deleting a fingerprint cache can force a rescan, potentially requiring scans of gigabytes of file contents. Do not remove archive or fingerprint files as a routine troubleshooting step. Preserve them, record what changed, and follow the version-specific recovery guidance when an archive is genuinely damaged or intentionally reset.
Rank #4
- Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Add versioned rollback copies
A synchronized second replica reflects changes, including unwanted deletions. Versioned copies give you a way to recover an earlier file. The following profile fragment keeps named-file backups in central storage:
backup = Name *
backuploc = central
backupdir = /srv/unison-backups
maxbackups = 7
backupprefix = .unison-$VERSION-
backupsuffix = .bak
What each preference means
| Preference | Purpose |
|---|---|
backup |
Selects the files for which Unison creates backup versions. Name * matches names according to Unison’s pattern rules. |
backuploc |
Chooses local or central backup storage. central uses the directory named by backupdir. |
backupdir |
Sets the central backup directory, which must be writable and have enough free capacity. |
maxbackups |
Sets how many versions Unison retains for a selected file; here the retention count is seven. |
backupprefix and backupsuffix |
Define the naming around the versioned backup file. The $VERSION variable is expanded by Unison. |
The backupcurr preference can keep the current version with version number 000. Central backups may be on a different filesystem with different security properties, ownership rules, and available space. Protect that directory accordingly and include its capacity in your storage plan. These rollback copies are separate from the second synchronized replica; having one does not eliminate the need to protect the other.
Schedule synchronization without overlapping jobs
Cron
The Ubuntu community guide documents cron scheduling. A simple example runs a named profile every 15 minutes:
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →*/15 * * * * /usr/bin/unison large-data -batch -logfile /var/log/unison-large-data.log
-batch suppresses interactive decisions, so use it only after manual runs have established the correct policy. Ensure the scheduled account can write the log, access both roots, and authenticate to the remote host if applicable. A cron job should not start while the destination is absent; combine it with a mount check or rely on the profile’s mountpoint guard for removable storage.
Systemd service and timer
Use a systemd service and timer when you need explicit ordering after a mount unit, resource limits, and journal logging. Make the service one-shot, run it as the account that owns the Unison archive, and arrange for the timer to trigger only after the required mount is available. A timer interval does not prevent overlap by itself; configure the service and interval so a second invocation cannot start while the first is still running.
Repeat mode and filesystem monitoring
Unison also supports repeat mode with a filesystem monitor. This can reduce polling delay for an active tree, but it still needs the same mount, permissions, conflict, and locking precautions as a scheduled run.
Do not run overlapping Unison processes against the same archive. Archive-lock and concurrent-access settings are safe only when you can guarantee that no other process will access those archives at the same time.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Restore files and validate the design
A backup is not demonstrated until a restore works. Ubuntu does not prescribe one universal restore-test interval; choose a cadence based on how often the data changes and how costly its loss would be.
Test an individual rollback
- Choose a representative file that has a known earlier version.
- Use Unison’s backup version for that file and restore it into a clean, separate directory rather than overwriting the live source.
- Compare its contents with a known checksum or an application-level validation.
- Check the expected filename, directory placement, permissions, and timestamp behavior.
Test the synchronized replica
- Choose a clean destination directory or spare test disk.
- Restore a representative directory from the second replica.
- Compare file counts, directory structure, checksums, permissions, and timestamps where those attributes matter.
- Document the steps and the time required so an actual incident does not become an improvised experiment.
Include files from different sizes and types, including a large file that receives partial edits and a directory containing many small files. A transfer that succeeds for a few documents does not prove that metadata, filenames, or the largest objects will restore correctly.
Best Value
- [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
- 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
- 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
- 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
- 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Unison compared with one-way synchronization and backup software
| Concern | Unison | One-way synchronizer such as rsync | Dedicated backup system |
|---|---|---|---|
| Synchronization direction | Bidirectional reconciliation between two replicas. | Normally source-to-destination unless separately orchestrated. | Usually backup-source to a repository; restore is a separate operation. |
| Independent edits | Detects updates on both sides and presents conflicts. | Normally applies the chosen source view over the destination. | Typically records backup points rather than merging live replicas. |
| Rollback versions | Available through backup preferences and retention settings. |
Requires additional snapshot or versioning design. | Often a central feature, with retention and repository management. |
| Transport | Local paths, separate disks, or SSH roots. | Local paths and network transports depending on how it is invoked. | Varies by product and repository. |
| Large changed files | Rsync-like delta transfer is available with rsync = true. |
Delta transfer is a core use case. | May use chunking, deduplication, or full-file storage depending on the system. |
| Protection from propagated deletion | Needs confirmation settings and versioned backups; a live replica alone is not enough. | Needs explicit deletion and retention safeguards. | Usually designed around retention, but the exact protection depends on configuration. |
Choose Unison when the important requirement is keeping two independently usable trees reconciled. Choose a dedicated backup design when immutable copies, extensive retention, deduplication, or centralized recovery management matter more than bidirectional editing.
Troubleshoot common failures
The job writes to the system disk instead of the USB drive
Stop the job, remove or quarantine any files created at the unmounted path, mount the intended device, and add or verify mountpoint. Confirm the device with findmnt before every recovery run.
Unison reports incompatible versions
Check unison -version on both endpoints, compare the Ubuntu package versions for their releases, and install compatible builds. Do not delete archives merely because a version mismatch appears.
The run is unexpectedly slow
Separate metadata scanning from content transfer when diagnosing. A tree with millions of small files can spend substantial time scanning even when few bytes change. Check disk latency, network throughput, inode availability, and the number of concurrent threads. Lower maxthreads on a constrained link, retain delta transfer for large files, and exclude reproducible caches.
The destination reports “no space” despite free gigabytes
Check both df -h and df -i. Inode exhaustion, central rollback copies, or a destination smaller than the source plus retained versions can all stop a run. Free space in the correct filesystem rather than the parent system disk.
A permission or metadata error appears on a USB disk
Verify the filesystem type and mount options. VFAT/FAT32 cannot represent all Unix permissions. Use a Linux-compatible filesystem when metadata matters, or set perms = 0 deliberately and document the resulting limitation.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Changes are proposed in the wrong direction
Cancel the run, inspect both roots and the last known synchronized state, and check whether a mount was missing or a path was mistyped. Re-run interactively with confirmbigdel = true; do not use -batch until the proposal is understood.
Repeated runs collide
Find the cron, timer, repeat-mode, or manually launched process that is still active. Stop overlapping invocations and ensure every scheduler uses the same archive and profile owner. Do not enable concurrent archive access unless you can guarantee exclusive control.
Operational checklist
- Install Unison from Ubuntu’s Universe repository and verify the version on every endpoint.
- Use a destination with enough capacity for live data and retained versions.
- Prefer a Linux-compatible filesystem when ownership and permissions matter.
- Verify removable mounts with
findmnt, capacity withdf -h, and inodes withdf -i. - Keep roots, exclusions, transport, and safety settings in a named profile under
~/.unison. - Protect removable paths with
mountpoint. - Leave
confirmbigdelenabled until repeated interactive tests are correct. - Use
rsync = true, tunemaxthreads, and considerstream = truefor the actual link and storage. - Add versioned backups when recovery from propagated deletion is required.
- Schedule only after manual validation, and prevent overlapping archive access.
- Restore representative files and directories on a planned cadence.
The practical answer
For a large Ubuntu directory, start with an interactive two-root run, then move the same configuration into a profile with exclusions, delta transfer, a conservative thread count, and a mount guard for removable storage. Use SSH when the second replica belongs on another host. Treat the synchronized copy as one layer of protection, add Unison’s retained versions for rollback, and periodically restore files to prove that the arrangement works when you need it.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools




