AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Source Servers (SRCDS) (https://forums.alliedmods.net/forumdisplay.php?f=130)
-   -   Batch file / create bz2's in mass quantities (https://forums.alliedmods.net/showthread.php?t=189717)

SlimeCounty 07-10-2012 06:35

Batch file / create bz2's in mass quantities
 
1 Attachment(s)
So, I was compressing tons of custom models, sounds, vmt's and vtf's (custom source materials, etc) this morning, and I mean TONS, doing each manually, getting them ready for my fastdl server. My buddy Squirrel pops into group chat, knows what I'm doing, and throws this batch file at me.

Works like a flipping charm. I thought I'd post it somewhere on these forums, as I feel this is something pretty damn useful for source server owners who compress/upload custom content in large quantities.

I'll attach the file below, but this file assumes 2 things...
7zip is installed in C:\Program Files\7-Zip\7z.exe
and that you want your files compressed to the .bz2 format.

HOW IT WORKS

First, you must have 7zip installed.
Place the .bat file into a directory containing all the files you wish to compress and drag those files into the .bat file, stand back, and watch as it compresses each file into it's own .bz2.

Here's the script, in case you need to change something to suit it for your needs.
Simply copy that into a new txt file, and name it whateveryouwant.bat.

Code:

@Echo Off
:Start
If [%1==[ Goto :EOF
PushD %~pd1
"C:\Program Files\7-Zip\7z.exe" u -tbzip2 %~nx1.bz2 %1
Shift
PopD
Goto Start


ReFlexPoison 07-10-2012 06:53

Re: Batch file / create bz2's in mass quantities
 
Wow, Imma have to try this. :)

Groger 07-10-2012 07:25

Re: Batch file / create bz2's in mass quantities
 
Does it crawls trough all the directories to? Cause you can allready drag & drop multiple files on the default bzip2.exe

SlimeCounty 07-10-2012 10:04

Re: Batch file / create bz2's in mass quantities
 
Quote:

Originally Posted by Groger (Post 1747276)
Does it crawls trough all the directories to? Cause you can allready drag & drop multiple files on the default bzip2.exe

No, it only compresses what you drop in it. Only time I've had any experience with bz2 was with 7zip, and there's no bzip2.exe in my installation.

Powerlord 07-10-2012 10:36

Re: Batch file / create bz2's in mass quantities
 
One thing I miss having moved to a Windows server from a Linux server is the ability to wget maps and things directly to my fast download server, and then be able to bzip2 -k *.bsp to convert them all to bz2.

Edit: -k was to keep the original bsp files so I could then use sftp to upload the files to my game server.

SlimeCounty 07-10-2012 12:07

Re: Batch file / create bz2's in mass quantities
 
That does sound nice.

checkster 07-10-2012 15:05

Re: Batch file / create bz2's in mass quantities
 
This will save some time for those who do not have a auto bzip on they're cite. Nice share bro.

Fearts 07-10-2012 21:57

Re: Batch file / create bz2's in mass quantities
 
This is very nice indeed. What compression level does it use?


EDIT:

My friend DHack sent me this link:

http://www.brainless.us/downloads.aspx?cid=1

natino 07-11-2012 02:53

Re: Batch file / create bz2's in mass quantities
 
can you use these compressed files by just putting them in the directory or on a webserver?

Powerlord 07-11-2012 15:26

Re: Batch file / create bz2's in mass quantities
 
Quote:

Originally Posted by natino (Post 1747854)
can you use these compressed files by just putting them in the directory or on a webserver?

I've heard that they will be used for downloads if you put them on the game server, but they're intended for a fast download webserver.

Side note: The game server itself doesn't understand bz2, so you must put the uncompressed maps on the game server itself.


All times are GMT -4. The time now is 02:34.

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