Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
VGSources
Blog

How to Back Up Large Directories with Unison on Ubuntu

A practical Ubuntu guide to Unison: synchronize large directories locally or over SSH, avoid missing-mount mistakes, tune transfers, retain rollback copies, and verify restores.
Length12 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Unison when you need two Ubuntu directory replicas to stay synchronized, whether the second replica is on another disk or a remote host over SSH. It reconciles changes made at either location, transfers only changed parts of large files when possible, and can keep separate versioned copies for rollback. It is not an inherently one-way, append-only backup program: a deletion accepted during synchronization can be propagated to the other replica. The safe setup is therefore an interactive first run, a reusable profile, a mount check for removable storage, and tested restores.

What Unison does—and what it does not

Unison maintains two replicas of a directory tree. It records the state it has already synchronized, compares each root on the next run, and applies non-conflicting changes in the appropriate direction. If a file changes only on the source, the change goes to the other root; if it changes only on the destination, the destination change can go back to the source. When both sides changed the same item, Unison stops for a conflict rather than silently choosing one version.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That bidirectional model is useful for a desktop and an external drive, or for two Ubuntu machines used by the same project. It is also the reason a second replica is not the same thing as an immutable backup. If you delete a directory and approve that deletion, the delete can reach the other root. Unison’s versioned backup preferences, described later, create rollback copies in addition to the synchronized replica.

Need What Unison provides Important qualification
Two locations kept current Two-way synchronization on local disks or over SSH Updates can travel in either direction.
Efficient updates to large files Rsync-style delta transfer and optional streaming Unison still scans metadata and maintains archive information.
Rollback after an accidental change Named or central versioned backup copies These consume additional storage and are separate from the second replica.
One-way, retention-heavy, immutable history Not Unison’s primary design A dedicated backup system may be a better fit for that requirement.

Prepare Ubuntu and the destination storage

Install a compatible Unison package

Ubuntu distributes Unison in the Universe repository. The Ubuntu package index listing from 2026 shows 2.53-series packages for Ubuntu 24.04 LTS (Noble) and newer suites. Install it with the normal package manager:

#1 Best Overall
WD 2TB My Passport, Portable External Hard Drive, Black, backup software with defense against ransomware, and password protection, USB 3.1/USB 3.0 compatible - WDBYVG0020BBK-WESN
  • Slim durable design to help take your important files with you
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • Back up smarter with included device management software[2] with defense against ransomware
  • Help secure your important files with password protection and hardware encryption
  • 3-year limited warranty
sudo apt update
sudo apt install unison

For a local synchronization, install Unison on the one computer that owns both roots. For an SSH synchronization, install a compatible Unison version on both the local and remote endpoints. The client and server do not have to be built for the same distribution, but their Unison versions must be compatible; check the package and manpage supplied by each Ubuntu release before automating the job.

Use storage that is genuinely separate

Ubuntu’s backup guidance recommends keeping backup copies somewhere separate from the computer, such as an external hard disk. Choose capacity for the source data plus any retained Unison versions, not merely the current size of the source. A network-connected drive, file server, or other machine can also serve as a second location. Physical separation matters: a drive left permanently beside the computer is still vulnerable to theft, fire, power damage, or an operator mistake that affects both devices.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use a Linux-compatible filesystem when ownership and permission bits matter.
  • Check free blocks with df -h and free inodes with df -i; a disk can have free gigabytes but no inodes for a many-file tree.
  • Confirm that the account running Unison can read the source and write the destination.
  • For a removable drive, decide the exact mount directory before writing the profile.

Choose local-disk or SSH roots

Synchronize to a mounted local disk

Mount the external disk first, then verify where Ubuntu mounted it. For example:

findmnt /media/alice/backup
df -h /media/alice/backup
df -i /media/alice/backup

The basic local invocation documented by Ubuntu is:

unison /home/$USER/data /media/$USER/backup/data

Replace both paths with the real source and destination. On the first run, Unison builds its archive and presents proposed creates, updates, and deletions. Keep this run interactive; do not add batch mode until you have confirmed that the roots and directions are correct.

Synchronize with a remote Ubuntu host over SSH

For a remote root, use an SSH URL in a profile or on the command line. A profile entry can look like this:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Kosbees 500 GB External Hard Drives,Portable Hard Drive for Windows,Ultra Slim External HDD Store Compatible with PC, MAC,Laptop,PS4, Xbox one, Xbox 360;Plug and Play Ready
  • 【Plug-and-Play Expandability】 With no software to install, just plug it in and the drive is ready to use in Windows(For Mac,first format the drive and select the ExFat format.
  • 【Fast Data Transfers 】The external hard drives with the USB 3.0 cable to provide super fast transfer speed. The theoretical read speed is as high as 110MB/s-133MB/s, and the write speed is as high as 103MB/s.
  • 【High capacity in a small enclosure 】The small, lightweight design offers up to 500GB capacity, offering ample space for storing large files, multimedia content, and backups with ease. Weighing only 0.35 Lbs, it's easy to carry "
  • 【Wide Compatibility】Supports PS4 5/xbox one/Windows/Linux/Mac and other operating systems, ensuring seamless integration with game consoles,various laptops and desktops .
  • Important Notes for PS/Xbox Gaming Devices: You can play last-gen games (PS4 / Xbox One) directly from an external hard drive. However, to play current-gen games (PS5 / Xbox Series X|S), you must copy them to the console's internal SSD first. The external drive is great for keeping your library on hand, but it can't run the new games.
root = /home/alice/data
root = ssh://backup.example:/srv/backup/alice-data

The remote account must be able to read the local data path as appropriate for the operation and write the destination directory. Configure and test ordinary SSH access first, then run Unison interactively so host-key prompts, permissions, and the proposed directions are visible. Keep compatible Unison versions at both ends; an SSH connection alone does not make incompatible archives safe.

Create a repeatable profile for a large tree

Unison reads named profiles from ~/.unison/. A profile prevents a long command line from changing between runs and keeps exclusions, transport choices, and safety settings together. Save the following as ~/.unison/large-data.prf, changing the roots and paths for your data:

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

Invoke it by its profile name:

unison large-data

path entries limit synchronization to named subdirectories. Omit them when the entire root should be synchronized. The sample ignores temporary files and cache directories; add only data that is reproducible or intentionally excluded. Keep the same profile on every machine that runs the job so one invocation does not unexpectedly include files another invocation omits.

Preference Purpose How to use it safely
confirmbigdel Requests confirmation before whole-replica or path deletions. Leave it enabled while learning the workflow; current Ubuntu manpage documentation enables it by default.
perms Controls permission synchronization. Use perms = 0 only when the destination filesystem cannot represent source permissions.
rsync Uses rsync-like delta transfer for changed file contents. Keep rsync = true unless a documented compatibility issue requires otherwise.
stream Streams file contents between endpoints. Set it to true when the endpoints and network benefit from streaming; verify behavior during an interactive run.
maxthreads Limits concurrent file operations. Balance CPU, disk, and link capacity; lower it for a constrained connection.
maxerrors Controls how many errors can accumulate before the run stops. The documented default is 1. A higher value can finish more of a tree, but can also postpone discovery of repeated failures such as a full disk.
mountpoint Requires a path to be a mounted filesystem before proceeding. Set it to the removable-drive mount directory so a missing drive causes an abort instead of a copy into an ordinary empty folder.
log Enables logging for the profile. Use a persistent, writable log location when scheduling the profile.

Run the first synchronization without risking the wrong root

  1. Mount and identify the destination. Run findmnt and verify that the expected filesystem, device, and mount directory appear. Do not rely on an empty directory name alone.
  2. Check capacity and access. Run df -h and df -i on the destination. Confirm ownership and test that the Unison account can create a temporary file there.
  3. Start the profile interactively. Use unison large-data without -batch. Read each proposed create, update, and deletion, especially changes that point from the destination back to the source.
  4. Perform a small directional test. Create a harmless test file in the source, synchronize, and verify it at the destination. Make a separate test change in the other root only if you intend to allow two-way updates, then observe the proposed direction.
  5. Remove the test data deliberately. Delete it only after confirming which side should receive the deletion. Keep confirmbigdel = true until the workflow is routine.
  6. Test the mount guard. Unmount the destination, run the profile, and confirm that Unison aborts because the configured mountpoint is absent. Remount it before the real run.

This process catches the most dangerous local mistake: a disconnected USB disk leaving its former mount directory behind as a normal folder. Without a guard, Unison can treat that empty directory as the destination and create a misleading local copy on the system disk.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Tune transfers for large directories

Use delta transfer for large changed files

Unison’s transfer protocol uses rsync-like compression and delta transfer for small changes in large files. With rsync = true, changing a small region of a large file can avoid sending the entire file when the endpoints can calculate matching blocks. This does not eliminate the initial full copy, metadata scanning, or the cost of traversing millions of entries.

Choose concurrency instead of assuming maximum is best

The Ubuntu manpage describes the default thread setting as intended for high concurrency. More parallel operations can help a fast local SSD, but can make a spinning disk, a busy system, or a narrow network link slower. Set maxthreads according to the slowest part of the path. On a low-bandwidth connection, the documentation specifically notes that a value such as 1 may be beneficial. Start with a modest value such as 4 for a mixed local workload, then adjust from observed CPU, disk, and network utilization rather than increasing it blindly.

Rank #3
WD 4TB My Passport, Portable External Hard Drive, Black, Backup Software with Defense Against ransomware, and Password Protection, USB 3.1/USB 3.0 Compatible - WDBPKJ0040BBK-WESN
  • Slim durable design to help take your important files with you
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • Back up smarter with included device management software[2] with defense against ransomware
  • Help secure your important files with password protection and hardware encryption
  • 3-year limited warranty

Stream when the path supports it

stream = true allows file contents to be streamed between endpoints. It can help when the connection and storage path favor sequential transfer. Keep it in the profile only after an interactive test confirms that the endpoint versions and transport behave as expected.

Exclude data that can be regenerated

Every excluded cache, build output, or temporary file reduces scanning and transfer work. Use stable profile rules such as ignore = Name *.tmp and ignore = Name .cache. Do not exclude irreplaceable saves, configuration, source material, or other files merely because they are large. An exclusion is a data-loss decision: Unison will not protect what the profile never synchronizes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Protect Unison’s archive and fingerprints

Unison stores archive and fingerprint information under ~/.unison. These records let it distinguish an independent update from a change it has already propagated. Deleting a fingerprint cache can force a rescan; the Noble manpage warns that rescanning may require reading gigabytes of file contents. Do not remove archive or fingerprint files casually, and do not copy a profile to a second account while assuming the new account has the same synchronization history.

Add versioned rollback copies

A synchronized second root protects against a failed primary disk, but it can also receive an accidental deletion. Use Unison’s backup preferences when you need older file versions:

backup = Name *
backuploc = central
backupdir = /srv/unison-backups
maxbackups = 7
backupprefix = .unison-$VERSION-
backupsuffix = .bak

backup = Name * selects the files for backup. backuploc chooses local or central storage; backupdir names the central directory in the example; and maxbackups = 7 retains seven versions according to Unison’s versioning rules. The backupcurr preference can keep the current version with version number 000 when that is useful for recovery.

Central backups are not magically free or isolated. The directory needs enough capacity for retained versions, and the account needs suitable permissions. The Unison manual notes that central backups may be on a different filesystem with different security properties and available space. Treat that location as another protected data store: monitor capacity, restrict access, and include it in restore tests. Versioned copies supplement the second synchronized replica; they do not replace a separate destination.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
WD 5TB My Passport, Portable External Hard Drive, Black, backup software with defense against ransomware, and password protection, USB 3.1/USB 3.0 compatible - WDBPKJ0050BBK-WESN
  • Slim durable design to help take your important files with you
  • Back up smarter with included device management software[2] with defense against ransomware
  • Help secure your important files with password protection and hardware encryption
  • 3-year limited warranty

Filesystem and removable-drive pitfalls

Permission-limited USB filesystems

Ubuntu’s Unison guide warns that VFAT and FAT32 USB media do not work well when Unix permissions must be preserved. Prefer a Linux-compatible filesystem for a backup disk that must retain ownership and mode bits. If the destination cannot represent those permissions and that loss is acceptable, deliberately set perms = 0 rather than letting every run produce misleading permission differences.

Missing mounts and wrong mount paths

Always verify the mount with findmnt before a manual run. Put the same path in the profile’s root and mountpoint settings. To prove the protection works, unmount the disk and run the profile; the job should stop instead of writing into the bare directory. Remount only after checking the device and filesystem shown by findmnt.

Full disks and inode exhaustion

A run that stops after many successful files may have reached a block or inode limit. Check both df -h and df -i on the destination and on the central backup directory if one is configured. Do not raise maxerrors simply to hide repeated failures. The documented default of 1 surfaces the first error quickly; increase it only when you have a reason to let independent files continue and a plan to inspect every reported failure.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Schedule synchronization only after the manual workflow is proven

Cron

The Ubuntu community guide documents cron scheduling. A simple fifteen-minute entry is:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
*/15 * * * * /usr/bin/unison large-data -batch -logfile /var/log/unison-large-data.log

Use -batch only after interactive runs have established the correct roots, exclusions, mount guard, and deletion policy. The scheduled account must be able to read both roots, write the log, and access the SSH key or other non-interactive authentication required by a remote root. Choose a persistent log location and review it for conflicts, errors, and unexpected deletions.

Repeat mode and filesystem monitoring

Unison also supports repeat mode with a filesystem monitor. This can react to changes instead of polling on a fixed cron interval. It still needs the same mount protection and conflict policy, and it must not run at the same time as another process using the same archive.

Best Value
Seagate One Touch 24TB External Hard Drive Desktop HDD - USB-C Compatible with Most Windows and macOS, Rescue Recovery (STNB24000400)
  • No wall warts: Work freely with its bus-powered USB-C. No wall outlet required.
  • Big on space: High-capacity storage to store all your files in one place.
  • Reliable backup: Safeguard assignments, projects, or sensitive files with trusted performance.
  • Fuss-free, clutter-free: One port, one cord, quick connect.
  • Peace-of-mind: Comes with two-year limited warranty and Rescue Data Recovery Services.

When to use a systemd service and timer

A systemd service and timer are preferable when the job must wait for a particular mount unit, have explicit resource limits, or write to the journal. Whichever scheduler you choose, enforce one active Unison process per archive. The manpage warns that archive-lock and concurrent-access settings are safe only when you can guarantee that no other instance accesses those archives.

Validate that you can restore

A successful synchronization is not proof that a usable backup exists. At a cadence based on how often the data changes and how costly loss would be, restore representative files into a clean directory.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Choose several file types, including a large file, a small file, a directory with nested content, and any data whose permissions or timestamps matter.
  2. Restore an individual file from Unison’s versioned backup copies, when those preferences are enabled, and verify that the expected older content is present.
  3. Restore a complete directory from the second replica into a separate test location rather than overwriting the live source.
  4. Compare checksums for file contents, inspect directory structure, and check permissions and timestamps where they are part of your requirements.
  5. Record which profile, backup location, and version you used so the procedure can be repeated after an incident.

Ubuntu’s guidance does not prescribe one universal restore-test interval. More frequently changing or more valuable data justifies more frequent tests; the useful standard is that a person can recover selected files and a whole directory without guessing how the profile was configured.

Decide whether Unison is the right layer

Criterion Unison One-way synchronizer such as rsync Dedicated backup system
Direction Bidirectional; independent updates can be reconciled. Usually source to destination unless custom logic is added. Usually source to backup repository.
Conflict handling Detects conflicting edits and asks for a decision. Normally follows the chosen source and options. Uses the backup product’s snapshot or version policy.
Rollback history Optional backup, backupcurr, and retention settings. Requires separate snapshots, rotations, or scripts. Usually a central retention feature, often with deduplication or immutability.
Transport Local disks and SSH roots. Local, SSH, and other transports depending on invocation. Depends on the product and repository.
Large-file changes Rsync-style deltas; concurrency and streaming are configurable. Strong one-way transfer tooling, with its own option set. May deduplicate or chunk data, depending on implementation.
Best fit Two working replicas that both may receive edits. A straightforward mirror where the source is authoritative. Retention-heavy, immutable, or disaster-recovery backups.

Choose Unison when the defining requirement is reconciling changes made independently on two replicas. Choose a one-way tool when the destination should never send updates back. Choose a dedicated backup system when immutable history, deduplication, or policy-driven retention matters more than keeping two working directories alike.

Troubleshoot common failures

The job wants to copy everything again

Check that you are running the same profile and account as before and that ~/.unison still contains the archive and fingerprint files for those roots. A deleted fingerprint cache can force a complete rescan. Verify that both root paths are spelled identically and that the destination has not been mounted at a different directory.

Unison reports permission differences on every run

Inspect the destination filesystem. VFAT and FAT32 cannot represent Unix permissions in the same way as a Linux filesystem. Move the destination to a Linux-compatible filesystem, or set perms = 0 only when preserving those bits is not required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A removable-drive run stops before transferring

Confirm the drive is mounted at the path in mountpoint, then inspect findmnt output for the expected device. This is the desired failure when the mount is absent; it prevents a copy into the system disk’s empty mount directory.

Transfers are slow over a narrow link

Keep rsync = true for delta transfers, reduce maxthreads—a value of 1 is specifically suggested for low-bandwidth links—and consider whether streaming helps this endpoint pair. Exclude caches and build outputs that do not need protection.

A deletion appeared on both replicas

That is consistent with Unison’s synchronization model when the deletion was approved. Recover the previous version from configured Unison backups if available, then review confirmbigdel, the interactive prompts, and the profile’s roots before the next run. A synchronized replica alone cannot provide rollback against an accepted deletion.

Quick Recap

Bestseller No. 1
WD 2TB My Passport, Portable External Hard Drive, Black, backup software with defense against ransomware, and password protection, USB 3.1/USB 3.0 compatible - WDBYVG0020BBK-WESN
WD 2TB My Passport, Portable External Hard Drive, Black, backup software with defense against ransomware, and password protection, USB 3.1/USB 3.0 compatible - WDBYVG0020BBK-WESN
Slim durable design to help take your important files with you; Help secure your important files with password protection and hardware encryption
$132.10
Bestseller No. 3
WD 4TB My Passport, Portable External Hard Drive, Black, Backup Software with Defense Against ransomware, and Password Protection, USB 3.1/USB 3.0 Compatible - WDBPKJ0040BBK-WESN
WD 4TB My Passport, Portable External Hard Drive, Black, Backup Software with Defense Against ransomware, and Password Protection, USB 3.1/USB 3.0 Compatible - WDBPKJ0040BBK-WESN
Slim durable design to help take your important files with you; Help secure your important files with password protection and hardware encryption
$181.00
SaleBestseller No. 4
WD 5TB My Passport, Portable External Hard Drive, Black, backup software with defense against ransomware, and password protection, USB 3.1/USB 3.0 compatible - WDBPKJ0050BBK-WESN
WD 5TB My Passport, Portable External Hard Drive, Black, backup software with defense against ransomware, and password protection, USB 3.1/USB 3.0 compatible - WDBPKJ0050BBK-WESN
Slim durable design to help take your important files with you; Help secure your important files with password protection and hardware encryption
$219.95
Bestseller No. 5
Seagate One Touch 24TB External Hard Drive Desktop HDD - USB-C Compatible with Most Windows and macOS, Rescue Recovery (STNB24000400)
Seagate One Touch 24TB External Hard Drive Desktop HDD - USB-C Compatible with Most Windows and macOS, Rescue Recovery (STNB24000400)
No wall warts: Work freely with its bus-powered USB-C. No wall outlet required.; Big on space: High-capacity storage to store all your files in one place.

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.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.