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
- With
🌐 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
| Option | Description |
|---|---|
--delete | Remove files in the destination that don’t exist in the source |
--progress | Show file transfer progress |
--exclude 'pattern' | Skip certain files/folders |
-z | Compress data during transfer |
--dry-run | Test 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.