rsync

फ़ाइल और डायरेक्टरी

इस्तेमाल

rsync -av [source]/ [dest]/

दो पेड़ों के बीच का सिर्फ़ अंतर भेजता है, स्थानीय या ssh पर; स्रोत के अंत का slash उसकी सामग्री का अर्थ रखता है, और उसे हटाने पर डायरेक्टरी एक स्तर और गहरी चली जाती है।

आम विकल्प

विकल्पअर्थ
-aArchive: recursive, keeping permissions, times and symlinks
-vList what is transferred
-zCompress while it travels
-PShow progress and keep partial files so a transfer can resume
--deleteRemove files in the destination that are gone from the source
-nDry run: print what would happen and change nothing
--excludeSkip paths matching a pattern
-eChoose 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