AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [batch] BZ2 pack/test integrity (https://forums.alliedmods.net/showthread.php?t=306468)

Dragokas 04-01-2018 11:15

[batch] BZ2 pack/test integrity
 
1 Attachment(s)
Here is 2 useful .bat scripts (OS Windows) I wrote for:

1) Pack all files in .bz2 to upload in content-server

Reason:
Packed files in content server save your clients time,
when they try to download many amount of MB.
Besides, archive can be easily checked for integrity.

2) Test integrity of all .bz2 archives.

Reason:
Sometimes hoster works buggy, your FTP client can upload file partially,
so to ensure all ok you need to download all files back and check all bz2 by this script.
If some files damaged you have to try download it again to be sure,
because sometimes that dem. hoster give you file partially too.
Today I said him good bye and use my own FTP. But you can still use your
buggy free of charge hoster, where this script can help you found a damaged file.

PREPARING SCRIPTS
1. Download archive, unpack scripts to separate folder.
2. Download bzip2.exe + bzip2.dll (e.g. from here: http://gnuwin32.sourceforge.net/packages/bzip2.htm)
3. Download 7za.exe + 7z.dll (https://www.7-zip.org/download.html) (included in archive).

Place exe, dll next to .cmd script.

USAGE.
A. Script "bz2_compress.cmd"
(P.S. Use compress_bz2_7z.cmd for better compression)

Variant 1. Drag & Drop folder to this script (or create shortcut for him and drag & drop folder on shortcut).
Variant 2. Run script and it will pack everything in subfolders.
Variant 3. Drag & drop file on script.

WARNING. All files after packing will be removed (in variants 1, 2).

B. Script "test_arc.cmd"

Variant 1. Drag & Drop folder on it.
Variant 2. Run script within a folder you want to check all .bz2 for integrity.

C. Script "bz2_unpack.cmd"

Intended to unpack .bz2 archives recursively.
Using: Drag & drop folder on script.
All original .bz2 files will be deleted.

Good luck,
Alex Dragokas.

ThatKidWhoGames 04-10-2018 22:23

Re: [batch] BZ2 pack/test integrity
 
Thank you for this!!

Dragokas 04-19-2018 16:25

Re: [batch] BZ2 pack/test integrity
 
Added C. Script "bz2_unpack.cmd"

Just in case.

Dragokas 11-30-2019 02:53

Re: [batch] BZ2 pack/test integrity
 
Added 7z bz2 compressor. It have a several bytes better compress level :)

Required file: %ProgramFiles(x86)%\7-Zip\7z.exe (default 7-zip installation location)

Ermert1992 12-11-2019 12:26

Re: [batch] BZ2 pack/test integrity
 
Thank you for this!!


All times are GMT -4. The time now is 16:15.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.