Difference between revisions of "rsync"
Jump to navigation
Jump to search
(New page: ==Overview== rsync is a Linux command-line application for synchronizing (i.e. making sure both copies have the latest versions of all files) a directo...) |
|||
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | == | + | ==About== |
− | [[rsync]] is a [[Linux]] [[command-line]] application for [[data synchronization|synchronizing]] (i.e. making sure both copies have the latest versions of all files) a directory tree between two machines.{{ | + | [[rsync]] is a [[Linux]] [[command-line]] application for [[data synchronization|synchronizing]] (i.e. making sure both copies have the latest versions of all files) a directory tree between two machines.{{seedling}} |
+ | ==Related Pages== | ||
+ | * [[backup software]] | ||
+ | * [[rclone]]: [[rsync]]-like application that works with many more protocols including low-priced cloud storage | ||
+ | ===user pages=== | ||
+ | * [[user:Woozle/rsync]]: full command, showing actual options we use, including machine names | ||
+ | ==Examples== | ||
+ | Copy a directory structure from <u>relsource</u> on <u>machine</u> to <u>reldest</u> on the local machine: | ||
+ | [[rsync]] -'''Pav''' <u>user</u>@<u>machine</u>:<u>relsource</u> <u>reldest</u> | ||
+ | * '''a''' is for 'archive', which is short for '''pr''' which are 'preserve' and 'recursive' | ||
+ | ** '''p''' ('preserve') preserves timestamps, permissions, etc. | ||
+ | * '''v''' is for 'verbose', which means it tells you what it's doing | ||
+ | * '''P''' is for 'progress' and 'partial', which allows for resuming an incomplete copy | ||
+ | ===Notes=== | ||
+ | * To keep files in sync in both directions, you have to run rsync in both directions as well; there is no single command to synchronize two directory trees. | ||
+ | * This probably does not also remove destination files deleted from the source. | ||
+ | * To use rsync in an automated script (e.g. for backups), see [[keyed login]] for password-less operation. | ||
+ | * Tentatively, to delete source files after copying to target, use <code>--remove-source-files</code>. | ||
+ | |||
==Links== | ==Links== | ||
+ | * {{l/manpage}} (also at: [https://linux.die.net/man/1/rsync linux.die.net] [https://ss64.com/bash/rsync.html ss64.com]) | ||
+ | ===How To=== | ||
+ | * '''2017-06-20''' [https://qbfreak.net/gs/index.php?id=blog&post=using-rsync-to-verify-file-trees-match Using rsync to verify file trees match] | ||
+ | * '''2014-06-03''' [https://askubuntu.com/questions/476041/how-do-i-make-rsync-delete-files-that-have-been-deleted-from-the-source-folder/665918#665918 How do I make rsync delete files that have been deleted from the source folder?] | ||
+ | * '''2010-06-25''' [https://superuser.com/questions/156664/what-are-the-differences-between-the-rsync-delete-options What are the differences between the rsync delete options?]* [http://www.mikerubel.org/computers/rsync_snapshots/ ''Easy'' Automated Snapshot-Style Backups with Linux and Rsync] | ||
* [http://www.scrounge.org/linux/rsync.html Use rsync to back up a directory tree of files]: a basic how-to | * [http://www.scrounge.org/linux/rsync.html Use rsync to back up a directory tree of files]: a basic how-to |
Latest revision as of 12:38, 1 August 2020
About
rsync is a Linux command-line application for synchronizing (i.e. making sure both copies have the latest versions of all files) a directory tree between two machines.
Related Pages
- backup software
- rclone: rsync-like application that works with many more protocols including low-priced cloud storage
user pages
- user:Woozle/rsync: full command, showing actual options we use, including machine names
Examples
Copy a directory structure from relsource on machine to reldest on the local machine:
rsync -Pav user@machine:relsource reldest
- a is for 'archive', which is short for pr which are 'preserve' and 'recursive'
- p ('preserve') preserves timestamps, permissions, etc.
- v is for 'verbose', which means it tells you what it's doing
- P is for 'progress' and 'partial', which allows for resuming an incomplete copy
Notes
- To keep files in sync in both directions, you have to run rsync in both directions as well; there is no single command to synchronize two directory trees.
- This probably does not also remove destination files deleted from the source.
- To use rsync in an automated script (e.g. for backups), see keyed login for password-less operation.
- Tentatively, to delete source files after copying to target, use
--remove-source-files
.
Links
- manpage (also at: linux.die.net ss64.com)
How To
- 2017-06-20 Using rsync to verify file trees match
- 2014-06-03 How do I make rsync delete files that have been deleted from the source folder?
- 2010-06-25 What are the differences between the rsync delete options?* Easy Automated Snapshot-Style Backups with Linux and Rsync
- Use rsync to back up a directory tree of files: a basic how-to