rsync -avz --delete /data/ user@remote:/backup/data/

Category: Self-Hosting

rsync -avz --delete /data/ user@remote:/backup/data/

Sync to remote and delete files on the destination that no longer exist locally — an exact mirror

Like rsync -avz but also deletes files at the destination that no longer exist at the source — creates an exact mirror.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.