↑ ↓ select, Enter open, Esc close

rsync and backup

Copy, sync and back up data reliably: rsync with the right options, tar archives and simple backup routines.

16 one-liners: 4 harmless, 11 caution, 1 destructive

All rsync and backup one-liners

Copy a directory locally with all permissions and attributes

#rsync -aHAX --info=progress2 /var/www/vhosts/ /mnt/newdisk/vhosts/
caution

Create a compressed tar backup with the date in the name

#tar -czf /var/backups/example.com-httpdocs-$(date +%F).tar.gz -C /var/www/vhosts/example.com/httpdocs .
caution

Extract a tar.gz archive without overwriting files

$mkdir -p /tmp/restore && tar -xzf /var/backups/example.com-httpdocs-2026-10-09.tar.gz -C /tmp/restore --skip-old-files
caution

Incremental backup with hard links using rsync --link-dest

#rsync -a --link-dest=/backup/example.com/aktuell /var/www/vhosts/example.com/httpdocs/ /backup/example.com/$(date +%F)/ && ln -sfn /backup/example.com/$(date +%F) /backup/example.com/aktuell
caution

List the contents of a tar.gz archive

$tar -tzvf /var/backups/example.com-httpdocs-2026-10-09.tar.gz | head -50
harmless

Mirror a directory exactly with rsync --delete

$rsync -av --delete /var/www/vhosts/example.com/httpdocs/ /backup/example.com/httpdocs/
destructive

For the websites on your server

Free SEO and PageSpeed check

GENLOC.SEO analyzes any domain for load time, Core Web Vitals and on-page issues and tells you in plain words what is going on. Available in 11 languages.

by GENLOC.NETWORK, the team behind myline.de

Restore a single file from a tar backup

$mkdir -p /tmp/restore && tar -xzf /var/backups/example.com-httpdocs-2026-10-09.tar.gz -C /tmp/restore ./wp-config.php
caution

Resume an interrupted transfer of large files

$rsync -avP /var/backups/example.com-2026-10-09.tar.gz webuser@backup.example.com:/home/webuser/backup/
caution

rsync with excluded directories and files

$rsync -av --exclude='wp-content/cache/' --exclude='*.log' /var/www/vhosts/example.com/httpdocs/ /backup/example.com/httpdocs/
caution

Run rsync with limited bandwidth

$rsync -avz --bwlimit=5000 /var/www/vhosts/example.com/httpdocs/ webuser@backup.example.com:/home/webuser/backup/httpdocs/
caution

Save checksums of all files in a directory

$cd /var/www/vhosts/example.com/httpdocs && find . -type f -exec sha256sum {} + > /tmp/example.com.sha256
caution

Stream a tar backup directly to another server over SSH

$tar -czf - -C /var/www/vhosts/example.com/httpdocs . | ssh webuser@backup.example.com 'cat > /home/webuser/backup/example.com-httpdocs.tar.gz'
caution

Test rsync with a dry run

$rsync -av --dry-run /var/www/vhosts/example.com/httpdocs/ /backup/example.com/httpdocs/
harmless

Transfer files to another server with rsync over SSH

$rsync -avz -e 'ssh -p 22' /var/www/vhosts/example.com/httpdocs/ webuser@backup.example.com:/home/webuser/backup/httpdocs/
caution

Verify a backup against the original using checksums

$rsync -rcn --itemize-changes /var/www/vhosts/example.com/httpdocs/ /backup/example.com/httpdocs/
harmless

Verify files against saved checksums

$cd /backup/example.com/httpdocs && sha256sum -c --quiet /tmp/example.com.sha256
harmless

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.