A little project for someone to take on if they wish...

Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Forum rules
Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Locked
Andy
User avatar
Administrator
Posts: 12620
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

A little project for someone to take on if they wish...

Post by Andy »

Hello all,

Im looking for someone to take on a small project for me. Its doesnt have to be complicated, it just has to do the job and be easy to use.

Basically I need a batch file/program of some sort that will:
1. Extract a RAR file in a folder into a temp folder
2. Recompress the contents of that file with "Best" compression using the same filename as the original.
3. Remove the temp files.
4. Remove the original file.
5. Move the new file to the location of the old file.
6. Loop to the beginning and start the next file.

If possible Id like it to check the RAR files current compression rate, but Im not sure if WinRAR allows this.

Incase anyone is wondering, I need this so we can significantly reduce the usage on the FTP server. This will also help with download times since the files will be smaller.
Last edited by Andy on Sat Jun 09, 2007 4:34 pm, edited 1 time in total.

ppc_digger
Donator
Posts: 590
Joined: Sat Aug 19, 2006 1:25 am
Location: Israel

Re: A little project for someone to take on if they wish...

Post by ppc_digger »

I can write a small shell script to do that, but you'll have to install bash and coreutils (a minimal Cygwin installation will do the trick).

Andy
User avatar
Administrator
Posts: 12620
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

Like I said, simple. Wouldn't a BAT file be able to do it?

ppc_digger
Donator
Posts: 590
Joined: Sat Aug 19, 2006 1:25 am
Location: Israel

Post by ppc_digger »

I have no idea how to loop the operation for each file. The rest can be easily done, though (maybe except for comparing the ratios). BAT files are just not powerful enough (and I have zero experience with Windows PowerShell).

expert01
FTP Access
Posts: 352
Joined: Thu Aug 24, 2006 6:28 pm

Post by expert01 »

BAT files can do loops.

You'll need to use the rar.exe program inside the winrar folder for this job.

ppc_digger
Donator
Posts: 590
Joined: Sat Aug 19, 2006 1:25 am
Location: Israel

Post by ppc_digger »

expert01 wrote:BAT files can do loops.
They can, but only predefined ones AFAIK. I guess another BAT file could generate a new one with a list of all the required files, but it would be very clumsy.

EDIT: Yeah, I still believe relying upon a standard UNIX shell that needs to be installed is simpler than writing complicated BAT files. bash and coreutils are just a 7 MB download combined, and with the Cygwin installer, the whole installation (including the download) takes about 3 minutes.

ewan275
FTP Access
Posts: 177
Joined: Sun Aug 27, 2006 6:37 pm
Location: UK, Home of RISCOS

Post by ewan275 »

You could use the commandline version of winrar.
Image

Andy
User avatar
Administrator
Posts: 12620
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

ewan275 wrote:You could use the commandline version of winrar.
Thats pretty obvious, but its making something to interact with it to do the job at hand thats the problem.

RentedMule
Donator
Posts: 937
Joined: Tue Oct 17, 2006 8:26 pm

$50

Post by RentedMule »

and its yours

Andy
User avatar
Administrator
Posts: 12620
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Re: $50

Post by Andy »

RentedMule wrote:and its yours
Yes it may be my problem, but Im asking for help. If you don't want to or can't help then don't post in the topic. Comments like that are pointless and annoying.

RentedMule
Donator
Posts: 937
Joined: Tue Oct 17, 2006 8:26 pm

...

Post by RentedMule »

rubbish. I offered him one hour of my time for a product he wanted. It's much cheaper than my normal rate. Don't hate because my time is worth something.

Andy
User avatar
Administrator
Posts: 12620
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Re: ...

Post by Andy »

RentedMule wrote:rubbish. I offered him one hour of my time for a product he wanted. It's much cheaper than my normal rate. Don't hate because my time is worth something.
Who said anyone way paying someone? And where did you say any particular rate?

RentedMule
Donator
Posts: 937
Joined: Tue Oct 17, 2006 8:26 pm

Here

Post by RentedMule »

Sometimes you PAY for work to get it done right... you know, like the difference between letting your 8 year old son mow the grass and a landscaping business.

Anyway, the topics in this forum are pretty worthless seeing as no one even notices them. I left the price of $50 in my topic. It was simply overlooked.

Andy
User avatar
Administrator
Posts: 12620
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

Think what you want but some people like to help and don't want a charge for every little thing they do. If you want to charge, feel free but don't complain if people won't pay you because someone else was nice enough to give it a bash themselves.

Oh, and if the topics in this forum are worthless, go and find somewhere else to ask for people's money.

Beta Freak
Posts: 786
Joined: Sat Oct 14, 2006 12:05 am

Post by Beta Freak »

RentedMule if you have nothing good to say, then don't say anything.

rawr
User avatar
FTP Access
Posts: 79
Joined: Sat Mar 17, 2007 2:01 am

Post by rawr »

So I wrote a script to do this... took an hour or two to get everything working plus some simple statistics and logging. But then I wondered how much effort it would take to support ZIPs as inputs, too. I was a bit surprised to find that the command line RAR doesn't support extracting zips; odd because the GUI does.... And that's when I remembered: WinRAR already has a batch conversion option.

Tools menu, Convert Archives.

Andy
User avatar
Administrator
Posts: 12620
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

rawr,

That is EXCELLENT!!! You are a saviour! Now to try it!

rawr
User avatar
FTP Access
Posts: 79
Joined: Sat Mar 17, 2007 2:01 am

Post by rawr »

I think you will be pleased with the results It's definitely a good idea for saving bandwidth and increasing availability. In my tests, for some files I gained a 35% reduction. Almost half of that came from using enabling "solid" archives, although in some files it didn't help too much. My settings:

1. best compression
2. dictionary size 4096K (this is the default for best compression i think)
3. solid archive

Andy
User avatar
Administrator
Posts: 12620
Joined: Fri Aug 18, 2006 11:47 am
Location: United Kingdom
Contact:

Post by Andy »

All we need is best compression. That will save space and bandwidth.

Locked