rsync

· 1 min read · Data and Storage · Tool

rsync copies files from one place to another and transfers only what changed, using file size, modification time or checksums. It works between local folders and over SSH to remote servers, which makes it the standard tool for backups, deployments of static files and migrations.

Key concepts #

  • Archive mode (-a): copies recursively and keeps permissions, owners, times and symbolic links.
  • Trailing slash: src/ copies the contents of the folder, src copies the folder itself.
  • --delete: removes from the destination what no longer exists in the source, so it makes an exact mirror.
  • --dry-run: shows what would happen without changing anything.
  • Snapshots: --link-dest makes incremental backups where unchanged files are hard links.

Learn it #

Follow the rsync tutorial: backups over SSH and schedule it with cron. For S3 the equivalent is aws s3 sync.

#Linux #Rsync #Backup