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, मैं अपनी मूल फ़ाइल को फिर से मिलता है.























{ 1 trackback } (1) Trackback
{ 2 comments… read them below or (2 टिप्पणियाँ ... उन्हें या नीचे पढ़ें add one एक जोड़ } )
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>
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 एक टिप्पणी छोड़ दो