linux_wiki:rsync

Differences

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

Link to this comparison view

Next revision
Previous revision
linux_wiki:rsync [2014/11/19 21:28]
billdozor created
linux_wiki:rsync [2019/05/25 23:50] (current)
Line 1: Line 1:
 ====== Rsync ====== ====== Rsync ======
-Rsync is good for local and over the network file copying.+ 
 +**General Information** 
 + 
 +Rsync can be used for local and over the network file copying.
 If the copy is interrupted, rsync will be able to only copy files and parts of files that it has not transferred yet. If the copy is interrupted, rsync will be able to only copy files and parts of files that it has not transferred yet.
  
-__Useful Options__+**Checklist** 
 +  * Distro(s): Any 
 + 
 +---- 
 + 
 +===== Useful Options =====
  
 There are a lot of options to rsync. The ones that I actually use are: There are a lot of options to rsync. The ones that I actually use are:
Line 22: Line 30:
     * This option is easier to show an example of instead of a description.     * This option is easier to show an example of instead of a description.
  
-=== Examples ===+---- 
 + 
 +===== Examples =====
  
-__Local File Copy__+==== Local File Copy ====
  
 Perform a local file system copy from one folder to another. Perform a local file system copy from one folder to another.
Line 30: Line 40:
 I would also normally want to see transfers in human readable format, details (verbose), and see the transfer progress. I would also normally want to see transfers in human readable format, details (verbose), and see the transfer progress.
  
-<code>+<code bash>
 rsync -ahvP /home/bill/scripts/ /backups/scripts/ rsync -ahvP /home/bill/scripts/ /backups/scripts/
 </code> </code>
  
-__Keeping Folders In Sync__+==== Keeping Folders In Sync ====
  
 Keep a destination in sync with whatever the source has. Keep a destination in sync with whatever the source has.
 In this case, the delete option would be desired, so if a file is deleted from the source, it is also removed from the destination on the next sync. (Which is probably run as a cron job) In this case, the delete option would be desired, so if a file is deleted from the source, it is also removed from the destination on the next sync. (Which is probably run as a cron job)
  
-<code>+<code bash>
 rsync -avhP --delete /home/bill/documents/shared/ /media/shared_docs/ rsync -avhP --delete /home/bill/documents/shared/ /media/shared_docs/
 </code> </code>
  
-__Excluding Folders/Files__+==== Excluding Folders/Files ====
  
 Perform a folder sync, but exclude certain folders matching a pattern in a file. Perform a folder sync, but exclude certain folders matching a pattern in a file.
  
-<code>+<code bash>
 rsync -avhP --delete -exclude-from=/home/bill/rsync_exceptions /home/bill/documents/shared/ /media/shared_docs/ rsync -avhP --delete -exclude-from=/home/bill/rsync_exceptions /home/bill/documents/shared/ /media/shared_docs/
 </code> </code>
Line 53: Line 63:
 The contents of rsync_exceptions could be: The contents of rsync_exceptions could be:
  
-<code>+<code bash>
 -/records/ -/records/
 -projects -projects
Line 68: Line 78:
 See the rsync man page and search for "FILTER RULES" to see more. See the rsync man page and search for "FILTER RULES" to see more.
  
-__Rsync in SSH Tunnel__+==== Rsync in SSH Tunnel ====
  
 You can tunnel rsync in a SSH tunnel for over the internet transfers. You can tunnel rsync in a SSH tunnel for over the internet transfers.
 It is much easier than it sounds, in fact..it is still a one line command. It is much easier than it sounds, in fact..it is still a one line command.
  
-<code>+<code bash>
 rsync -ahvP -e "ssh" /home/bill/scripts/ bill@1.2.3.4:/backups/scripts/ rsync -ahvP -e "ssh" /home/bill/scripts/ bill@1.2.3.4:/backups/scripts/
 </code> </code>
 The above opens a SSH tunnel to "bill@1.2.3.4" and sends normal rsync copy operations through the encrypted tunnel to the destination system. The above opens a SSH tunnel to "bill@1.2.3.4" and sends normal rsync copy operations through the encrypted tunnel to the destination system.
  • linux_wiki/rsync.1416450501.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)