📁 File Management 📖 Official

Ordner synchronisieren und vergleichen

Dateien zwischen Ordnern synchronisieren, Unterschiede vergleichen und Inhalte konsistent halten

★★☆ Intermediate 10-15 min 12. Januar 2025
📋

Scenario

💬

Prompt

Please compare the differences between these two folders:
- Source: ~/Documents/Projects
- Target: /Volumes/USB/Projects
Show:
- Files that only exist in the source folder
- Files that only exist in the target folder
- Files that exist in both but have different content (determined by modification time or checksum)
- Summary of total count and total size

Then execute one-way sync:
- From ~/Documents/Projects to /Volumes/USB/Projects
- Only copy new and updated files
- Keep extra files in the target folder (don't delete)
- Show sync progress and completed file count
- Log sync activity to ~/sync_log.txt

Expected Result

💡

Tips

  • Die Verwendung der rsync-Parameter -avh zeigt den detaillierten Fortschritt an. Mit --exclude können Dateien ausgeschlossen werden, die nicht synchronisiert werden müssen, wie .DS_Store, node_modules usw.