Batch Compression - One archive per File

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Batch Compression - One archive per File

Post by JAB Creations »

On XP I'm wondering if there is a way to do a batch compression. I essentially want to compress my access logs which are originally compressed via gzip by the server. I've gotten slightly better compression by Winrar and then again a slightly better compression ratio from Winzip. I'd like to essentially tell the program one archive per file ... for four years worth of monthly access logs. Suggestions?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

I would use the WinZip Command Line Support Add-on

Then create a batch file to automate the process
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

7-zip for the win, simply because it's open-source. You can get very good ratios with 7z, although the format is not very well known.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

And for the batch file part

Code: Select all

FOR /R %%i IN (*) DO 7z a -tzip %%i.zip %%i
if you're not using a file it's %i instead of %%i
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Post by JAB Creations »

Thanks for the replies! I've downloaded 7-ZIP (I *have* heard of it btw). Took me only a minute to find (Context-Menu - 7-Zip - Add to archive) where to stick the parameters (kinda cool to have a "console" option in a GUI 8)) but I'm getting an error "parameter incorrect" and I've modded the parameter in the way Volka suggested too.

The documentation seems really good for the most part but I'm a bit confused trying to reference some of the switches and %?
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Post by JAB Creations »

Using max compression...
jabcreations.com_2007-01.gz - 8.85MB
jabcreations.com_2007-01.rar - 4.11MB
jabcreations.com_2007-01.zip - 3.36MB
jabcreations.com_2007-01.7z - 5.24MB (No parameters used/LZMA/Ultra)
jabcreations.com_2007-01.7z - 3.44MB (No parameters used/PPMd/Ultra)
jabcreations.com_2007-01.7z - 5.01MB (No parameters used/BZip2/Ultra)
Post Reply