Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Creating rar files of a certain size

  1. #1
    Join Date
    Nov 2006
    Location
    Denton, TX, USA
    Beans
    14
    Distro
    Ubuntu 8.04 Hardy Heron

    Creating rar files of a certain size

    When you right click on a file you want to archive and click on Create Archive, you can select rar, but is there any way to get more specific? I'd like to get a rar thats 100MB and uses only minimal compression, because there it's only video, and thats compressed enough anyway. I know the command line to do this is:

    Code:
    rar a -v100000 filname.rar filename.avi
    or at least thats how to divide it up, I'm not sure how to specify compression.

    Is there a way to make a script or something that I can put in the menu next to create archive? Or at least a way to have those options in the gui?

    Thanks,
    echris1

  2. #2
    Join Date
    Nov 2007
    Location
    Central Coast, California
    Beans
    1,789

    Re: Creating rar files of a certain size

    For Dolphin and Konqueror, I know you can create service menus, but I know nothing about GNOME. That said, why again do you not want to compress it fully? I don't think it's quite possible to do what you're asking except possibly by having a script that compresses using several different levels and finds the one closest using a binary search or something, but that's completely inefficient for whatever it is you're trying to do.
    I do not use Ubuntu any more, nor have I ever used Gnome. Therefore, I tend to give advice that is distro- and DE-agnostic, which, while perhaps not the easiest way, will allow you to move freely between machines.

  3. #3
    Join Date
    Nov 2006
    Location
    Denton, TX, USA
    Beans
    14
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Creating rar files of a certain size

    It's not that I don't want to compress it fully, I just want to store it, break it up into 100MB sized rar files. The compression doesn't matter at all. I guess I'm really just wondering how to add things to the right click menu.

  4. #4
    Join Date
    Apr 2007
    Beans
    2,641
    Distro
    Ubuntu

    Re: Creating rar files of a certain size

    You might need a proprietary version of rar to create multi-volume archives of a preset size. Even then, no version for Linux might be available.

    I would stick with free software. Because video is highly compressed, I would not attempt to compress furhter (will hardly work) but directly split the file in 100 Mb chunks using the "split" tool, which is by default present on your system. See "man split" for how it works.

  5. #5
    Join Date
    Jan 2008
    Beans
    188

    Re: Creating rar files of a certain size

    Code:
    rar a -v10000k archive.rar <files>
    thats about 100 mb files
    Anish
    http://blogial.com
    Microsoft gives you windows;linux gives you the whole house.

  6. #6
    Join Date
    Nov 2006
    Location
    Denton, TX, USA
    Beans
    14
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Creating rar files of a certain size

    Thanks subzero, I left out the k, but I was wondering if it's possible to add that command to the right click menu, so if I were to right click on a video file or something, I would see an option to compress into 100MB chunks. Is there a way to put something in that menu to launch a console and execute that command?

  7. #7
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Creating rar files of a certain size

    Quote Originally Posted by echris1 View Post
    Thanks subzero, I left out the k, but I was wondering if it's possible to add that command to the right click menu, so if I were to right click on a video file or something, I would see an option to compress into 100MB chunks. Is there a way to put something in that menu to launch a console and execute that command?
    Install the nautilus-actions package. After it is installed:

    System -> Preferences -> Nautilus Actions Configuration -> Add

    Label - SplitRarFile
    Tooltip - Create split rar archive from file
    Icon - just pick one you like

    Take the following and save it in your home dir as splitrar.sh

    Code:
    #!/bin/bash
    
    for file in "$*"
    do
    
    rar a -v10000k archive.rar $file
    
    done
    Right click saved file -> Properties -> Permissions -> Allow Executing File as program

    Use path to file in Nautilus configuration

    Path - /home/username/splitrar.sh
    Parameter - %m

    Save the action. ALT + F2, killall nautilus. After that when you right click on a file you should have a menu item called SplitRarFile. Selecting that action will now run the script and create the split rar files in the directory.

  8. #8
    Join Date
    Nov 2006
    Location
    Denton, TX, USA
    Beans
    14
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Creating rar files of a certain size

    I have it all setup, and the menu item shows up, but when I select it nothing happens. No extra processes start running and no terminals pop up. Is there something I'm missing somewhere?

  9. #9
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Beans
    1,393
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Creating rar files of a certain size

    Did you make sure the splitrar.sh file is executable? You might go over all the settings again. It worked fine when I tested it on my computer.

  10. #10
    Join Date
    Nov 2006
    Location
    Denton, TX, USA
    Beans
    14
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Creating rar files of a certain size

    It is set to be executable, still nothing happening. The nautilus action setup looks like this:



    and the splitrar.sh looks like this:

    Code:
    #!/bin/bash
    
    for file in "$*"
    do
    
    rar a -v10000k archive.rar $file
    
    done
    I was wondering if it is also possible to change archive.rar to $file.rar?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •