User Tools

Site Tools


rsync

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rsync [2022/07/19 20:52] – created 85.134.209.200rsync [2022/10/21 19:47] (current) – Updated formatting admin
Line 2: Line 2:
  
 Syntax: Syntax:
- rsync -ave ssh user@server:source destination+<code>rsync -ave ssh user@server:source destination</code>
 Example: Example:
 +<code>
  rsync -ave ssh user@server:/home/steviewdr/public_html /home/steviewdr/  rsync -ave ssh user@server:/home/steviewdr/public_html /home/steviewdr/
 +#or
 + rsync -ave "ssh -p 2222" /home/user/folder/ username@remotedestinationserver:/home/user/folder/
 +</code>
  
 ====== Scenario - Migrating MySQL Server ====== ====== Scenario - Migrating MySQL Server ======
Line 13: Line 17:
  
 ===== rsync switches used for sync ===== ===== rsync switches used for sync =====
 +<code>
  #ssh into current mysql server, and run:  #ssh into current mysql server, and run:
  rsync -avPin --delete /var/lib/mysql newhost:/var/lib/  rsync -avPin --delete /var/lib/mysql newhost:/var/lib/
Line 22: Line 27:
  n = dry run (remove the n, for the proper run)  n = dry run (remove the n, for the proper run)
  --delete = delete files on target, which were deleted on host since last run.  --delete = delete files on target, which were deleted on host since last run.
 +</code>
 After than runs. Stop MySQLd on current server, and run the same rsync again. After than runs. Stop MySQLd on current server, and run the same rsync again.
rsync.1658260370.txt.gz · Last modified: 2022/07/19 21:13 (external edit)