Find the answer to your Linux question:
Results 1 to 3 of 3
hello, Please dont laught at me for posting this Ok so i downloading stuff over newsserver using nzbperl.pl so i get lots of .rar .r00 ... to unrar then to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Posts
    2

    newb bash scripting


    hello,

    Please dont laught at me for posting this

    Ok so i downloading stuff over newsserver using nzbperl.pl
    so i get lots of .rar .r00 ... to unrar then to sort and to delete so i *tryied* to make a script to unrar , then delete the rars and finally to move the .avi to a folder . It works great when i have one movie to decompress but when there is more than one stuff to unrar it messes up.

    Anyway there is my code :
    Code:
    #!/bin/bash
    # unrar - delete - sort
    
    FILM_DIR=/film
    NZB_DIR=/home/djpate/nzbdownload
    RAR_DIR=/home/djpate/rar
    NZBD_DIR=/home/djpate/nzbdownload/nzbdone
    
    cd $NZB_DIR
    
    $RAR_DIR/unrar e *.part01.rar
    $RAR_DIR/unrar e *.rar
    $RAR_DIR/unrar e *.part01.rar
    $RAR_DIR/unrar e *.rar
    $RAR_DIR/unrar e *.part01.rar
    $RAR_DIR/unrar e *.rar
    
    rm -f $NZB_DIR/*.r*
    rm -f $NZB_DIR/*.par2
    rm -f $NZB_DIR/*.PAR
    rm -f $NZB_DIR/*.PAR2
    rm -f $NZB_DIR/*.nfo
    rm -f $NZB_DIR/*.NFO
    rm -f $NZB_DIR/*.sfv
    rm -f $NZB_DIR/*.SFV
    
    mv *.avi $FILM_DIR
    
    mv *.nzb $NZBD_DIR
    
    echo Finit
    It is my first script please keep that in mind lol
    thanks in advance

  2. #2
    Linux Newbie
    Join Date
    Apr 2005
    Location
    South America
    Posts
    152
    What exactly do you mean "it messes up", I mean, doesnt it decompresses whatcha need or something?

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Posts
    2
    the thing is that it decompresses the first movie.then instead of doing the second one it does the first one again and then its removes all the rars so i loose the cd2.
    it thought unrar e *.part01.rar would do the first one and then the seconde one but it doesnt seem to work that way...

Posting Permissions

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