For local backups between a computer and an external drive (FireWire/USB connected), the rsync command you found is fundamentally correct:
rsync -aE --delete /path/to/source /Volumes/ExternalDrive/Backups
The flags breakdown:
- -a: Archive mode (preserves permissions, timestamps, etc.)
- -E: Preserve extended attributes (Mac-specific)
- --delete: Remove files in destination that no longer exist in source
While the basic command works, consider these enhancements for better reliability:
rsync -aAXvh --progress --delete --backup --backup-dir=/Volumes/ExternalDrive/DeletedFiles \
/path/to/source /Volumes/ExternalDrive/Backups
New flags explanation:
- -X: Preserve extended attributes (cross-platform)
- -v: Verbose output
- -h: Human-readable numbers
- --progress: Show transfer progress
- --backup: Make backups of existing files
For network shares or encrypted drives, you might need additional parameters:
rsync -aAXz --no-o --no-g --delete \
--exclude='*.tmp' --exclude='.DS_Store' \
/path/to/source /Volumes/EncryptedDrive/Backups
Create a nightly backup job by adding this to your crontab:
0 2 * * * /usr/bin/rsync -aE --delete /Users/me/Documents /Volumes/BackupDrive
If you encounter permission problems, try:
rsync -aE --delete --super --times \
/path/to/source /Volumes/ExternalDrive/Backups
For filesystem compatibility issues between macOS/Windows/Linux:
rsync -rltDv --delete /path/to/source /mnt/backup
When setting up local backups to an external drive, rsync remains one of the most powerful yet straightforward tools available. The core command you've encountered:
rsync -aE --delete /source/path /Volumes/BackupDrive/BackupFolder
is indeed sufficient for most basic backup scenarios. Let's break down why this works and when you might need more complex configurations.
The -a
flag is actually a combination of several useful options:
-r (recursive)
-l (copy symlinks as symlinks)
-p (preserve permissions)
-t (preserve modification times)
-g (preserve group)
-o (preserve owner)
-D (preserve device files and special files)
The -E
flag is macOS-specific, preserving extended attributes and resource forks. For Linux systems, you'd typically use -X
instead for extended attributes.
While the basic command works well, consider these enhancements for professional-grade backups:
rsync -aAXv --delete --delete-excluded \
--exclude='*.tmp' \
--exclude='.Trash/*' \
--exclude='.cache/*' \
/source /destination
Here we've added:
-v
for verbose output--delete-excluded
to remove excluded files from destination- Common exclusion patterns
-X
for Linux extended attributes (use-E
for macOS)
For scheduled backups, create a simple cron job (Linux/macOS) or scheduled task (Windows with cygwin):
# Run daily at 2 AM
0 2 * * * /usr/bin/rsync -aE --delete /source /destination
For Windows users using WSL:
schtasks /create /tn "DailyBackup" /tr "wsl rsync -aE --delete /mnt/c/Users/ /mnt/d/Backups" /sc daily /st 02:00
Always verify your backups with:
rsync -n -av --delete /source /destination
The -n
flag performs a dry run, showing what would be copied without making actual changes.
For very large backups or frequent small updates, consider these optimizations:
rsync -aE --delete --partial --progress --stats \
--bwlimit=5000 \
--log-file=/var/log/rsync_backup.log \
/source /destination
Parameters explained:
--partial
: Keep partially transferred files--progress
: Show transfer progress--bwlimit
: Throttle bandwidth (KB/s)--log-file
: Create a detailed log