compress & split files into volumes with recovery record and decompress files using RAR [from command line]
Target:
need to compress a large folder which is more than 200GB.
Demands:
- 1. Compress
- 2. Spliting into small files
- 3. Encryption
- 4. Recovery Record
That's the reason why I chose "winrar". 7zip doesn't have "recovery record" and it even compressed the meta data, which is not good for saving files.
For compressing
rar a -r -k -ep1 -v512m -hp -m3 -rr5p /path/to/backup.rar ./*
explanation:
create splitted compressed volumes under this folder "./*"
-v512m (the size of every splitted file: 512MB)
-p (encrypt using password)
-h (encrypt folder names and file names)
-m3 ( compression rate 3. Range from 1 to 5, the higher the smaller for the compressed file. by default it's 3)
-k (lock the compressed file which doesn't allow accidentally modifying the folder)
-r (recursivly compress all files under all folders)
-rr5p ( add recovery record 5%, which will make the file 5% bigger )
(tips: don't use fixed "-s" flag, coz if one file is damaged, it will be very hard to recover. From: https://www.zhihu.com/question/414666298)
for more infomation about rar command lines, visit https://selboo.com/post/582/
for knowing better about recovery record using RAR , visit here: https://documentation.help/WinRAR/HELPCmdRR.htm
By default, with -rr flag using command line, winrar add 3% of recovery record. I read somewhere from the internet, it said that if your file is smaller than 100MB, set recovery record to be 5%, if it's really big, then 3% will be okay.
You can not set the recovery record more than 100% because it's even bigger than the file itself.
Recovery record is not universal. If either the recovery record or the meta data of the compressed file is damaged, you can never recover your compressed file!!!
One joke: if you set your recovery record to be 100%, why don't you save another copy of your file?
The reason why we have Recovery record is that we want to recovery compressed files when we download compressed file from "bad" internet, or when we save our files on hard drive, something accidentally happens so that we can have the "recovery record" to recover the compressed files.
For decompressing
unrar x backup.part1.rar -p /path/to/extract/to
file the first splitted compressed volume
-p (if your compressed file has password, enter password after this command)