Linux rsync Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux rsync Guide
Complete beginner-friendly guide to rsync on Linux, covering Arch Linux, CachyOS, and other distributions including file synchronization, backup strategies, and efficient file transfer.
Table of Contents
rsync Installation
Install rsync
Arch/CachyOS:
# Install rsync
sudo pacman -S rsync
Debian/Ubuntu:
sudo apt install rsync
Fedora:
sudo dnf install rsync
rsync Basics
Copy Files
Basic usage:
# Copy files
rsync source/ destination/
# Copies files from source to destination
Dry Run
Test without copying:
# Dry run (test)
rsync -avn source/ destination/
# -a = archive mode
# -v = verbose
# -n = dry run (no actual copy)
Synchronization
Archive Mode
Preserve everything:
# Archive mode
rsync -av source/ destination/
# -a = archive (preserves permissions, timestamps, etc.)
# -v = verbose (shows progress)
Delete Extra Files
Mirror source:
# Delete files not in source
rsync -av --delete source/ destination/
# --delete = removes files not in source
Remote Sync
Over SSH
Remote synchronization:
# Sync to remote server
rsync -av source/ user@server:/path/destination/
# Uses SSH for transfer
From Remote
Download from server:
# Sync from remote server
rsync -av user@server:/path/source/ destination/
# Downloads from remote
Troubleshooting
rsync Not Found
Check installation:
# Check rsync
which rsync
# Install if missing
sudo pacman -S rsync
Permission Denied
Check permissions:
# Ensure read access to source
ls -la source/
# Ensure write access to destination
Summary
This guide covered rsync usage, file synchronization, and backup strategies for Arch Linux, CachyOS, and other distributions.
Next Steps
- Backup and Restore - Backup strategies
- scp Guide - Simple file copying
- SSH Configuration - SSH setup
- rsync Documentation:
man rsync
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.