2

I am searching for a command line alternative to rar.exe from winrar which supports the multitude of options that rar.exe does, preferably one that is open source.

Specifically, I am searching for a program that supports at least the following options:

  • "freshen" when unzipping, i.e. overwrite existing files only if they are older than the ones in the zip
  • move files in a zip ( zip and delete original if succesfull)
  • zip only files with archive attribute, remove archive attribute
  • zip only files newer than x / older than x / smaller than x ...
  • when updating an archive, keep previous versions of each changed file within the same archive (rar -ver[n])
  • set which part of the relative path should be included when compressing or extracting

The most complex free tool that I found, 7zip, only supports very few options (unless I am missing something).

The disadvantage of winrar is that it is shareware, and its command line tool cannot create anything besides rar format (One can use many of the command line switches with the gui winrar, but then there is no console output).

Is there a free alternative that can do it all?

1
  • I'd post your shopping list on the 7zip forum in the format of "how do I do X,Y & Z with 7zip" and see what kind of answers you get (and post the results back here :-). Commented Jul 16, 2010 at 21:13

2 Answers 2

1

Stop using rar.

You will never find what you are looking for, because the RAR format is proprietary, and the creators have shown no interest in opening the specifications. There are no compelling reasons to use it over any number of alternatives.

If you are looking for open source then you are not looking for RAR.

0

If you feel comfortable with writing shell scripts, then I recommend Cygwin. It is a linux command shell emulator for Windows. It has a lot of the command line features that linux does. With this, you are able to tar files together, that is make them one single archive and compress them.

It also has a 7zip utility that will allow you to zip your files if you prefer the .zip format. Personally I prefer the .gz. I find the compression to be better. Also, you can rar files. All you have to do is compile the source and that is provided free of charge from rarlab.com (where you get WinRar).

Anyway, with that said, you will be able to control many aspects of the of the archiving tasks that you are trying to complete. The caveat however, is to be able or willing to learn how to write shell scripts.

[http://www.cygwin.com/]

[http://www.rarlab.com/rar_add.htm]

1
  • The rarlabs source can only unrar, not create archives, and the license explicitely forbids adding that functionality. Writing scripts is a last resort, but I always worry I forgot a corner case. For things like zipping only files smaller than x, this is comparatively easy to write, but something like zip&remove should really be an atomar operation, it is too easy to lose data otherwise. And I have no idea how to tackle things like keeping previous versions in the zip. Is there perhaps a script collection available that tackles such common archiving tasks?
    – Hugo
    Commented Jul 9, 2010 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .