Install rsync on Debian

Here’s a simple, step-by-step guide to set up and use rsync on Debian LXQt — whether you’re syncing locally, over SSH, or automating backups.


🧩 1. Install rsync

It’s probably already installed, but to be sure:

sudo apt update
sudo apt install rsync

You can verify:

rsync --version

📁 2. Basic Local Usage

Example: sync one folder to another

rsync -avh /source/folder/ /destination/folder/
  • -a → archive mode (preserves permissions, times, etc.)
  • -v → verbose
  • -h → human-readable output
  • The trailing slash on /source/folder/ matters:
    • With /source/folder/ → copies contents only
    • Without /source/folder → copies the folder itself

🌐 3. Sync over SSH

You can copy files between computers securely using SSH.

Example: local → remote

rsync -avh -e ssh /home/user/data/ username@remotehost:/home/username/backup/

Example: remote → local

rsync -avh -e ssh username@remotehost:/home/username/backup/ /home/user/data/

You can also use an SSH key for passwordless automation:

ssh-keygen -t ed25519
ssh-copy-id username@remotehost

Then rerun your rsync command — it’ll connect without prompting for a password.


⚙️ 4. Useful Options

OptionDescription
--deleteRemove files in the destination that don’t exist in the source
--progressShow file transfer progress
--exclude 'pattern'Skip certain files/folders
-zCompress data during transfer
--dry-runTest what will happen without making changes

Example:

rsync -avh --delete --progress --exclude '*.tmp' /data/ /mnt/backup/

⏰ 5. Automate with cron (Optional)

To back up automatically, edit your user’s cron jobs:

crontab -e

Add something like:

0 2 * * * rsync -a --delete /home/user/data/ /mnt/backup/

This runs every day at 2 AM.


🖥️ 6. (Optional) GUI Front-Ends for LXQt

If you prefer a GUI, you can install a frontend:

sudo apt install grsync

Then launch it from your LXQt menu → System Tools → Grsync.

It gives you checkboxes for most rsync options.

Leave a Comment

Licensed under CC BY-NC 4.0

DevOps viewpoints are those of its owner. You may share and adapt this article for non-commercial purposes, provided proper attribution is given. Attribution should include:

Title: Install rsync on Debian
Author: peter arthur martin
Original URL: https://www.woodcentral.com/-/peter/install-rsync-on-debian/
License: CC BY-NC 4.0

Site Index

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.