How to Create a Multi Part Tar File with Linux कैसे Linux के साथ एक मल्टी भाग tar फाइल बनाएँ

by Sukrit Dhandhania on May 25, 2009 Sukrit Dhandhania द्वारा 25 मई 2009 पर

लिनक्स

Sometimes when you want to store your backup or any other large set of files online or want to share them someone else you need to find a way to compress and split the files into chunks of 100 or more Megabytes. कभी कभी आप अपने बैकअप या फ़ाइलों को ऑनलाइन के किसी अन्य बड़े सेट की दुकान या उन्हें का हिस्सा किसी और तुम एक तरीका संक्षेप और 100 या अधिक मेगाबाइट्स की मात्रा में फ़ाइलों को विभाजित खोजने की जरूरत है चाहता हूँ जब चाहते हैं. I felt the need for this as well recently when I wanted to store my backups online and the online storage service had a cap of 100 MB per file. मैं इस के लिए आवश्यकता के रूप में अच्छी तरह से हाल ही में लगा जब मैं अपने बैकअप ऑनलाइन स्टोर और ऑनलाइन भंडारण सेवा फ़ाइल प्रति 100 MB का एक टोपी था चाहता था. I found a really neat solution based on the tar command. मैं एक बहुत ही साफ राल कमान के आधार पर हल मिल गया. Using this method I split my backup of about 1 GB into 10 chunks of 100 MB each with incremental filenames. इस पद्धति का उपयोग करके मैं 100 एमबी वृद्धिशील filenames के साथ प्रत्येक के 10 मात्रा में लगभग 1 GB का मेरा बैकअप विभाजित.

The 1 GB file I wanted to split was called dbbackup.db . 1 जीबी फ़ाइल मैं विभाजन चाहते थे dbbackup.db बुलाया गया था. Here's the command I ran to create multiple tar files of 100 MB each out of it: यहाँ कमान मैं इसे 100 में से प्रत्येक MB के कई tar फाइल बनाने के भाग गया है:

# tar -cf – dbbackup.db | split -b 100m – db_backup.tar # निशाना cf - | विभाजन ख 100 मीटर dbbackup.db - db_backup.tar

This command took a long time to run. इस कमान के एक लंबे समय के लिए भाग लिया. Once it was done running I was left with ten files, 100 MB each named db_backup.taraa , db_backup.tarab , db_backup.tarac , and so on and so forth. एक बार इसे चला मैं दस फाइलों के साथ छोड़ दिया था, किया गया था 100 MB एक नाम db_backup.taraa, db_backup.tarab, db_backup.tarac, और इतने पर और आगे तो.

Now I can copy these files to my external storage or ship them with ease. अब मैं अपनी बाह्य भंडारण के लिए इन फ़ाइलों की प्रतिलिपि या उन्हें आसानी से पोत कर सकते हैं. To stitch the 1GB file back together all I need to do is to run the following command: 1GB करने के लिए वापस एक साथ फाइल सभी मुझे क्या करना चाहिए सिलाई के लिए निम्न कमांड चलाने है:

# cat db_backup.tara* | (tar x) # बिल्ली db_backup.tara * | राल (x)

And voila, I get my original file again. और voila, मैं अपनी मूल फ़ाइल को फिर से मिलता है.

Related Posts: संबंधित पोस्ट:
  • How To Apply Custom Themes To Windows XP SP3 Windows XP SP3 लागू करने के लिए कस्टम विषयवस्तुओं के लिए कैसे
  • How to encrypt your Linux backups कैसे अपने बैकअप लिनक्स एन्क्रिप्ट करने
  • Simplehelp Recap: May 2007 – wow, and thank you! Simplehelp हालात: मई 2007 - वाह, और धन्यवाद!
  • How to save the output of a Linux command to a file कैसे एक फ़ाइल में एक Linux कमान के उत्पादन को बचाने के लिए
  • Linux command line magic – find and replace Linux कमांड लाइन जादू - खोजें और जगह
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! बस अपने ईमेल इनबॉक्स के लिए मुफ्त हर दिन - में यह एक तरह सरल सहायता ट्यूटोरियल जाओ! Just enter your email address below: बस नीचे अपना ईमेल पता दर्ज करें:

    You can always opt out of this email subscription at any time. तुम हमेशा इस ईमेल सदस्यता से बाहर किसी भी समय विकल्प चुन सकते हैं.

    { 1 trackback } (1) Trackback

    Articles Collection of May'09 « Dako-Tux लेख May'09 «Dako का संग्रह-Tux
    06.24.09 at 6:14 am 6:14 पर 06.24.09 हूँ

    { 2 comments… read them below or (2 टिप्पणियाँ ... उन्हें या नीचे पढ़ें add one एक जोड़ } )

    1 1 Don Birdsall डॉन Birdsall 05.26.09 at 5:50 am 5:50 पर 05.26.09 हूँ

    Perhaps I am missing something. शायद मुझे कुछ याद आ रही है. For a single large file why not simply use the split command by itself? एक बड़ी फाइल के लिए क्यों विभाजन आदेश का उपयोग नहीं बस अपने आप? Executing a single command might be faster than executing both tar and split. एक कमांड से अधिक तेजी से क्रियान्वित हो सकता है निष्पादित दोनों राल और विभाजन.

    split –bytes=1024b sdbackup.db db_backup_ विभाजन बाइट्स = 1024b sdbackup.db db_backup_
    cat db_backup_* > joined_file.db बिल्ली db_backup_ * joined_file.db>

    2 2 Neil 05.26.09 at 1:19 pm 1:19 पर नील 05.26.09

    Perhaps a better example would show the same operation used on multiple folders शायद एक बेहतर उदाहरण ही एकाधिक फ़ोल्डर्स पर इस्तेमाल किया आपरेशन दिखा सकते हैं

    # tar -cf – /var/www /var/ftp | split -b 100m – my_backup.tar # निशाना cf - var / www / var / FTP | विभाजन ख 100 मीटर - my_backup.tar

    To guard against missing or damaged pieces, install “par2cmdline”, and create parity files so that you can repair missing pieces. को गायब या क्षतिग्रस्त टुकड़े के खिलाफ, गार्ड स्थापित "par2cmdline", और समता फ़ाइलें तो बना है कि आप याद कर टुकड़े की मरम्मत कर सकते हैं.

    To create parity files with a 15% redundency: एक% 15 redundency के साथ समता फाइल बनाने के लिए:
    # par2 create -r15 my_backup.tara* # Par2 बनाने के r15 my_backup.tara *
    To verify: इस बात की पुष्टि:
    # par2 verify my_backup.taraa.par2 # Par2 my_backup.taraa.par2 सत्यापित
    To repair missing pieces: को गायब टुकड़े की मरम्मत:
    # par2 repair my_backup.taraa.par2 # Par2 my_backup.taraa.par2 मरम्मत
    To combine the pieces and extract: के टुकड़े और निकालने के गठबंधन:
    # cat my_backup.tara? # बिल्ली my_backup.tara? | (tar x) | राल (x)

    Leave a Comment एक टिप्पणी छोड़ दो

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> आप ये HTML टैग और विशेषताएँ: <a href="" उपयोग title=""> <abbr title=""> <acronym कर सकते हैं <blockquote title=""> <b> cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>