How to use rsync for backups

Answered
Jan 05, 2026 797 views 1 answers
43

I need to synchronize files between servers. How do I use rsync effectively?

L
Asked by layla_web
Bronze 276 rep

1 Answer

11
# Basic sync
rsync -avz /source/ /destination/

# Sync to remote server
rsync -avz -e ssh /local/ user@remote:/path/

# Important flags
# -a: archive mode (preserves permissions)
# -v: verbose
# -z: compress during transfer
# --delete: remove files not in source
# --dry-run: test without changes
# --progress: show progress

# Backup with date
rsync -avz --backup --backup-dir=/backup/$(date +%F) /data/ /backup/current/
A
Answered by ahmed_tech 1 week, 2 days ago
Platinum 151 rep

Your Answer

You need to be logged in to answer questions.

Log In to Answer

Related Questions

Hot Questions

No hot questions available.