rsync
फ़ाइल और डायरेक्टरी
इस्तेमाल
rsync -av [source]/ [dest]/दो पेड़ों के बीच का सिर्फ़ अंतर भेजता है, स्थानीय या ssh पर; स्रोत के अंत का slash उसकी सामग्री का अर्थ रखता है, और उसे हटाने पर डायरेक्टरी एक स्तर और गहरी चली जाती है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -a | Archive: recursive, keeping permissions, times and symlinks |
| -v | List what is transferred |
| -z | Compress while it travels |
| -P | Show progress and keep partial files so a transfer can resume |
| --delete | Remove files in the destination that are gone from the source |
| -n | Dry run: print what would happen and change nothing |
| --exclude | Skip paths matching a pattern |
| -e | Choose the remote shell, as in -e "ssh -p 2222" |
उदाहरण
rsync -avP big.iso server:/data/Copies with progress, and can resume later.
rsync -av --delete site/ /backup/site/Makes the backup an exact mirror.
rsync -avn src/ dst/Dry run first; nothing is written.
हटाना, मिटाना और ढूँढना। कुछ कमांड दोबारा नहीं पूछते, इसीलिए -i लगाने की आदत हाथ बचाती है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. rsync क्या करता है?
दो पेड़ों के बीच का सिर्फ़ अंतर भेजता है, स्थानीय या ssh पर; स्रोत के अंत का slash उसकी सामग्री का अर्थ रखता है, और उसे हटाने पर डायरेक्टरी एक स्तर और गहरी चली जाती है।
Q. इसे कैसे लिखें?
rsync -av [source]/ [dest]/ — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 8 दिए हैं; पूरी सूची man rsync में है। यह कमांड फ़ाइल और डायरेक्टरी में आती है।
मिलती-जुलती कमांड
man पेज: man rsync