Raised This Month: $ Target: $400
 0% 

[BATCH] FastDL .bz2 recursive bzip2 compress


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-07-2015 , 14:49   Re: [BATCH] FastDL .bz2 recursive bzip2 compress
Reply With Quote #1

OK, dunno about for Windows, but here's a Linux/OSX/Cygwin version of bzip.sh that uses 7zip instead.

Assuming 7z is the name of the 7zip executable that is.

Code:
#!/bin/bash

FILE=$(basename $0)

if [ ! -d compress ]
then
        mkdir compress
fi

find . -type f ! -name "*.bz2" ! -name "${FILE}" -print0 | xargs -0 -I % 7z a -tbzip2 compress/%.bz2 %
find . -path "./compress" -prune -o -name "*.bz2" -print0 | xargs -0 -I % cp % compress/%
This probably also works if bzip.sh is in a different directory, as I changed how bzip.sh is removed from the find list.

Note: I didn't redirect its output to /dev/null, so it'll show the status of each file as it comes up.

Edit: Updated to copy any existing bz2 files into the compress folder.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-07-2015 at 15:13.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:36.


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