Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
linux_wiki:rsync [2014/11/19 21:28] billdozor created |
linux_wiki:rsync [2015/03/09 22:58] billdozor |
||
---|---|---|---|
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, | If the copy is interrupted, | ||
- | __Useful Options__ | + | **Checklist** |
+ | * Distros: All | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== 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 | + | ==== 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. | ||
- | < | + | < |
rsync -ahvP / | rsync -ahvP / | ||
</ | </ | ||
- | __Keeping | + | ==== Keeping |
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) | ||
- | < | + | < |
rsync -avhP --delete / | rsync -avhP --delete / | ||
</ | </ | ||
- | __Excluding | + | ==== Excluding |
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. | ||
- | < | + | < |
rsync -avhP --delete -exclude-from=/ | rsync -avhP --delete -exclude-from=/ | ||
</ | </ | ||
Line 53: | Line 63: | ||
The contents of rsync_exceptions could be: | The contents of rsync_exceptions could be: | ||
- | < | + | < |
-/records/ | -/records/ | ||
-projects | -projects | ||
Line 68: | Line 78: | ||
See the rsync man page and search for " | See the rsync man page and search for " | ||
- | __Rsync | + | ==== 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. | ||
- | < | + | < |
rsync -ahvP -e " | rsync -ahvP -e " | ||
</ | </ | ||
The above opens a SSH tunnel to " | The above opens a SSH tunnel to " |