↑ ↓ select, Enter open, Esc close

#rsync

9 one-liners with this tag.

All one-liners tagged rsync

Copy a directory locally with all permissions and attributes

#rsync -aHAX --info=progress2 /var/www/vhosts/ /mnt/newdisk/vhosts/
cautionrsync and backup

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
cautionrsync and backup

Mirror a directory exactly with rsync --delete

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

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/
cautionrsync and backup

rsync with excluded directories and files

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

Run rsync with limited bandwidth

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

Test rsync with a dry run

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

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/
cautionrsync and backup

Verify a backup against the original using checksums

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

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.