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.

By Peter Martin

“Age is something that doesn’t matter, unless you are a cheese.” ― Luis Buñuel

Leave a Reply

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

👍 This page answered my questions

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