DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween 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
World desk12 min

How to Install and Configure rsnapshot for Backups on Ubuntu

A complete Ubuntu guide to installing rsnapshot, configuring retention and backup points, using SSH for remote hosts, testing snapshots, scheduling cron, and estimating disk space.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install rsnapshot with sudo apt-get install rsnapshot, configure /etc/rsnapshot.conf, test the configuration and a dry run, then enable the supplied cron schedule. rsnapshot uses rsync and hard links, so it can retain multiple point-in-time directory snapshots without copying unchanged files repeatedly.

What rsnapshot does

rsnapshot is an rsync-based filesystem snapshot utility for local and remote filesystems. It copies selected directories into a snapshot root, rotates those snapshots according to retention levels, and uses hard links for files that have not changed. The result looks like a series of full backups while the storage used is approximately one full backup plus copies of files that changed between snapshots.

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.

This is file-level protection. It is not a complete disk image, bare-metal recovery system, or managed cloud-recovery service. You restore individual files or directories from the retained snapshot tree. If the Ubuntu installation itself is lost, you reinstall a working system, install rsnapshot again, mount the snapshot disk, and copy data back.

What you need before installing

  • An Ubuntu system with administrative access through sudo.
  • A destination for snapshot_root. A separate disk, such as an external USB hard drive, keeps backups on a different failure domain from the operating-system disk.
  • Enough capacity for the source data, the files likely to change, and the number of retained intervals. There is no universal disk-size recommendation.
  • For remote sources, network reachability and SSH access that does not prompt for a password.
  • A retention plan, such as daily snapshots for a week, weekly snapshots for a month, and monthly snapshots for several months.

Mount a removable destination at a stable path before configuring rsnapshot. Cron jobs cannot write to a disk that is unplugged or mounted somewhere else. If the destination is not mounted, stop the job rather than allowing snapshots to fill the system disk at the mount-point directory.

#1 Best Overall
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • 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.

Install the Ubuntu package

  1. Refresh package metadata if your system has not been updated recently.
  2. Install rsnapshot:
sudo apt-get install rsnapshot

The Ubuntu Noble manpage identifies package version 1.4.5-2 in the current Noble package documentation. The exact version installed depends on the Ubuntu release and repositories enabled on your machine.

The package places the main configuration at /etc/rsnapshot.conf and supplies a cron file at /etc/cron.d/rsnapshot. Start from the packaged example configuration when available, but review every path and retention value instead of enabling it unchanged.

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

Configure /etc/rsnapshot.conf

Edit the file as root:

sudoedit /etc/rsnapshot.conf

rsnapshot’s configuration syntax is strict: parameters and values must be separated by tabs, not spaces. A line that looks aligned in an editor can still fail if it contains spaces. Keep comments on separate lines and preserve the spelling of each directive.

Choose snapshot_root

snapshot_root is the directory under which rsnapshot creates its interval directories. Give it a trailing slash and place it on the backup filesystem:

snapshot_root    /mnt/backup/rsnapshot/

Replace /mnt/backup/rsnapshot/ with the actual mounted path. Do not point it at a source directory or at a location that is itself included in a backup point, because that can cause recursion and consume space unexpectedly.

For an external USB disk, create or select a dedicated directory on the mounted filesystem and verify that the account running the job can write there. Keep the drive disconnected or off-site when backups are not running if you need protection from theft, electrical damage, or ransomware that can reach mounted storage.

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

Set the retention levels in order

Each retain line defines an interval name and how many copies of that interval to keep. List levels from most frequent to least frequent:

Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • 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.
retain    daily      7
retain    weekly     4
retain    monthly   12

The first, most-frequent level performs the filesystem synchronization. Higher levels rotate snapshots from the preceding level. In this example, a daily run keeps seven daily snapshots; weekly runs promote the appropriate daily snapshot into the weekly series; monthly runs promote a weekly snapshot. The number of retained copies is a policy choice, not a statistic about how much space rsnapshot will consume.

Every interval named in retain must be the interval you call manually or from cron. If you define daily, weekly, and monthly, use those exact names in commands and schedule entries.

Add local backup points

A backup line contains the source directory followed by the directory name to create below the current snapshot:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
backup    /home/          localhost/
backup    /etc/           localhost/
backup    /usr/local/     localhost/

These examples protect users’ home directories, system configuration, and locally installed programs. Add only directories you understand and have permission to read. A trailing slash on the source expresses the directory contents; keep the packaged example’s style consistent throughout the file.

With the example above, a daily snapshot will contain paths such as /mnt/backup/rsnapshot/daily.0/localhost/home/. The exact interval-directory naming follows the rsnapshot configuration and version supplied by Ubuntu.

Exclude data that should not be copied

Use rsync exclusion directives for caches, temporary trees, generated build output, or other data that can be recreated. Exclusions reduce both the first full copy and future change volume, but an exclusion also means that data cannot be restored from rsnapshot. Document exclusions so another administrator knows what is intentionally absent.

Do not exclude configuration or application data merely because it is inconvenient to copy. Check the restore consequences first, particularly for databases: a live database directory may not be internally consistent when copied as ordinary files. Use the application’s own dump or export process for databases, then back up the resulting dump.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • 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.

Back up a remote host over SSH

Remote sources use rsync over SSH. A typical entry follows the Ubuntu documentation’s form:

backup    [email protected]:/home/    example.com/

The source is the remote account, host, and path; the final field is the directory name under the snapshot. Substitute an account with the minimum read permissions needed. Many servers disable direct root SSH login, in which case use an approved administrative account and arrange read access to the required directories.

Set up passwordless authentication

  1. On the Ubuntu machine that runs rsnapshot, create a dedicated SSH key if one does not already exist:
    ssh-keygen -t ed25519

    Choose a protected key location. An unattended cron job cannot answer an interactive passphrase prompt, so use an operationally appropriate key-management design rather than placing a personal interactive key in the job.

  2. Install the public key in the remote account’s ~/.ssh/authorized_keys using your approved access procedure. If permitted in your environment, ssh-copy-id [email protected] can perform this step.
  3. Test the exact connection as the account that cron will use:
    ssh [email protected]

    Confirm that host-key verification has already completed and that no password or confirmation prompt appears.

  4. Test rsync access to the intended path before running rsnapshot. A failure here will also fail the backup, usually with a more useful error message than a scheduled job provides.

Protect the private key and restrict its use on the remote side where possible. Record which hosts and directories the key can access, and rotate or revoke it when the backup relationship changes.

Validate the file before taking a snapshot

Run the checks in this order after every meaningful configuration change:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Check syntax and required settings:
sudo rsnapshot configtest

A successful result indicates that rsnapshot can parse the configuration. It does not prove that a disk is mounted, a source exists, SSH works, or enough space is available.

  1. Preview the commands for one interval without changing data:
sudo rsnapshot -t daily

The -t option prints the commands rsnapshot would execute. Review source paths, the snapshot root, excludes, remote host names, and rotation commands. Use the interval that you actually configured; replace daily if your first level has another name.

  1. Run the interval after the preview is correct:
sudo rsnapshot daily

The first run transfers the selected data and can take substantially longer than later runs. Watch its output and check the destination afterward. Inspect a newly created snapshot and verify that representative files, permissions, and directory names are present before relying on automation.

Rank #4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • 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.

For a remote job, perform the first successful run while you can observe SSH and rsync errors. Fix connectivity, permissions, missing paths, or host-key problems before enabling cron.

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

Schedule automatic snapshots with cron

Ubuntu’s default cron file is /etc/cron.d/rsnapshot. After a successful manual run, edit it as root:

sudoedit /etc/cron.d/rsnapshot

Ubuntu documents this example schedule:

0 4  * * *           root    /usr/bin/rsnapshot daily
0 3  * * 1           root    /usr/bin/rsnapshot weekly
0 2  1 * *           root    /usr/bin/rsnapshot monthly

These entries run daily at 04:00, weekly on Monday at 03:00, and monthly on the first day of the month at 02:00, according to the machine’s cron timezone. They are examples, not mandatory times. Choose a window when the source is available and the network and USB destination are reliable.

Make sure the interval names in the cron file exactly match the retain lines. Keep enough time between jobs for the preceding run to finish; overlapping rsnapshot processes can contend for the same snapshot tree. If your distribution’s cron service is disabled or unavailable, enable an equivalent scheduler only after confirming how it handles the root user and environment.

After saving the file, check the cron service logs and the snapshot directory after the next scheduled run. Cron provides no interactive opportunity to unlock a disk, accept an SSH host key, or enter a password, so every prerequisite must be unattended.

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.

How much disk space does rsnapshot need?

The manpage describes the requirement as roughly the size of one full backup plus a copy of each additional file that changes. Unchanged files in later snapshots are hard links to the existing data, so seven daily directories do not automatically require seven times the source size.

Actual consumption depends on four variables:

  • Initial data set: the size of all included files in the first successful snapshot.
  • Change rate: files rewritten or deleted between intervals require additional stored content. Rewriting a large file consumes space comparable to storing another copy even if only a small logical portion changed.
  • Retention depth: more daily, weekly, or monthly copies provide a longer recovery window but preserve changed versions for longer.
  • Exclusions and growth: excluding caches lowers usage, while new files and expanding logs increase it.

Measure the data you intend to include, estimate how much changes during each interval, and leave headroom for growth and filesystem overhead. Start with shorter retention, observe real usage over several rotation cycles, and then increase retention if the destination has room. No official source establishes a universal capacity figure.

Best Value
Sale
UnionSine 500GB Ultra Slim Portable External Hard Drive HDD-USB 3.0 | for PC, Mac, Laptop, PS4, Xbox one, Xbox 360-(Black)
  • [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.

Hard links work only when the source copies and snapshot files are on a filesystem that supports them. Keep the complete snapshot tree on one suitable filesystem and avoid designs that silently replace the destination with a mount lacking the required capabilities.

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

Local and remote designs compared

Design Advantages Costs and failure modes Best fit
Local source to a separate mounted disk Fast restore access and no network dependency during a run The backup host and source can be lost together if the destination remains attached; the disk must be mounted for cron A workstation or server with a dedicated internal or USB destination
Remote source over SSH Separates the source host from the machine storing snapshots and can centralize backups Requires reliable networking, key-based SSH, remote permissions, and host availability Protecting servers from a central Ubuntu backup host
Removable or off-site destination Reduces exposure to local hardware failure, theft, and some ransomware scenarios Backups stop while the device is disconnected; someone must mount, verify, and rotate it Periodic offline copies and recovery from a separate location

Choose retention and restore speed together. A long retention policy on a slow removable disk may be less useful than a shorter policy that can be restored quickly and verified regularly.

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

Using an external USB hard drive

An external USB hard drive is a practical physical destination for Ubuntu rsnapshot backups. Select usable capacity from the source size and retention calculation, not from a generic “backup drive” label. Check that the drive’s filesystem supports the permissions, ownership, timestamps, and hard links your backup requires.

  1. Connect the drive and identify its mounted path using your normal Ubuntu disk-management tools.
  2. Create a dedicated directory for snapshots, for example /mnt/backup/rsnapshot/, and ensure the mount is active before editing snapshot_root.
  3. Run sudo rsnapshot configtest, then sudo rsnapshot -t daily and a real manual interval.
  4. Confirm that the destination remains mounted after reboot if unattended jobs are required. Use a stable mount configuration appropriate to your Ubuntu installation.
  5. Test unplugged or off-site procedures: know when the cron job must be disabled, how the disk is reconnected, and how you will verify the first run afterward.

Keep at least one recovery path that is not permanently connected to the Ubuntu host. rsnapshot does not protect against every event that can simultaneously modify the source and an attached destination.

Restore files from a snapshot

Snapshots are ordinary directory trees. Browse the interval you need below snapshot_root, locate the host directory and original path, and copy the required file or directory back to its destination. Preserve ownership, modes, timestamps, and symbolic links when using a copy command, and restore into a temporary location first when the impact of overwriting live data is unclear.

For a large restore, use a tool that can preserve metadata and show progress, and verify available space on the target. If the newest snapshot is damaged or incomplete, select an earlier interval and document the recovery point. A successful backup job is not proof of recoverability until you have opened representative files or performed a test restore.

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.

Troubleshooting common failures

Symptom Likely cause Action
configtest reports a syntax or parameter error Spaces used where tabs are required, a misspelled directive, or an invalid path Open /etc/rsnapshot.conf, replace separators with tabs, check spelling, and run sudo rsnapshot configtest again.
The dry run targets an unexpected directory Incorrect snapshot_root, source, or destination field Read the complete output from sudo rsnapshot -t daily; correct the relevant line and preview again before running a real interval.
Remote backup asks for a password The cron account lacks a usable SSH key, or the key is protected by an interactive passphrase Test SSH as the same account, install the authorized public key on the remote host, and use a controlled unattended-key arrangement.
Remote backup cannot verify the host The SSH host key has not been accepted in the job’s account environment Connect interactively as that account, verify the host identity, and complete host-key setup before scheduling.
No new files appear on the USB destination The drive is disconnected, mounted elsewhere, or not writable Mount it at the configured path, check write permissions and free space, then run the dry run and manual interval again.
Disk usage grows faster than expected Large files are rewritten often, retention is deep, or exclusions are missing Measure changes over several intervals, review included paths and exclusions, and adjust retention only after deciding which recovery points can be removed.
Old data remains after removing a backup point Removing a configuration line does not delete archived files already stored in snapshots Identify the old data in each retained snapshot, confirm it is no longer needed, and remove it manually using a deliberate, verified cleanup procedure.

Operational and security practices

  • Run configtest and a dry run after changing paths, retention, excludes, SSH targets, or mount points.
  • Review cron logs and destination growth rather than assuming a zero exit status means every source was readable.
  • Use least-privilege remote accounts and restrict backup SSH keys where your server policy permits.
  • Protect the snapshot disk from unauthorized access; snapshots may contain private keys, credentials, personal documents, and configuration secrets.
  • Keep a written inventory of backup points, exclusions, retention values, mount paths, and remote hosts.
  • Perform periodic test restores. A directory listing proves that files exist; opening restored documents and checking application data proves that the recovery process works.
  • Plan what happens when the destination is full. A shorter, verified retention policy is safer than allowing the filesystem hosting the operating system to fill unexpectedly.

What rsnapshot cannot replace

rsnapshot provides versioned copies of files, not application-aware transactions, disk images, or a hosted disaster-recovery service. It does not automatically delete old archived files when you remove a backup line. It also cannot make an unavailable USB disk or unreachable SSH host available to cron. For databases, virtual machines, and other stateful systems, create consistent exports or snapshots using the application’s own tools and include those outputs in the rsnapshot plan.

For stronger disaster recovery, combine the local snapshot tree with an offline or separate-location copy and a documented rebuild procedure. Keep the scope clear: rsnapshot is the file-level layer in that plan.

Quick Recap

Bestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$129.99
Bestseller No. 2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$219.99
Bestseller No. 3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
Bestseller No. 4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$189.99

Installation and scheduling checklist

  1. Install the package with sudo apt-get install rsnapshot.
  2. Mount and verify the destination filesystem.
  3. Edit /etc/rsnapshot.conf using tabs between every parameter and value.
  4. Set snapshot_root to the destination path.
  5. Define retain levels from most frequent to least frequent.
  6. Add local or rsync-over-SSH backup points and deliberate exclusions.
  7. Run sudo rsnapshot configtest.
  8. Review sudo rsnapshot -t daily or the first configured interval.
  9. Run one real interval manually and inspect representative files.
  10. Enable and tailor /etc/cron.d/rsnapshot.
  11. Monitor the first scheduled rotations, destination capacity, and test restores.

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.

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 from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair 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.