[linux][easy] Rar files into X size splits

Status
Not open for further replies.

Avek

Member
21
2009
0
20
CatchItBaby asked me for this so here we go:

PHP:
#!/bin/bash
#Author: Avek
#Add all files/folders from folder to different archives
#Delete files/folders after successfully adding to rar
#Split to volume set in mb by user - 1st option eg
#./script 10 = 10mb splits Standard size = 100 mb

if [ $1 ]; then
  SIZE=$(($1 * 1024))
else
  SIZE=$((100 * 1024))
fi
Sname=`echo $0 | sed 's/.\///g'`;

for x in *
do
  if [ "$x" == "$Sname" ]; then
    echo -ne;
  elif [ -d "$x" ] || [ -e "$x" ]; then
      rar a -df -m0 -v"$SIZE"k "$x".rar "$x"
  fi
done
 
6 comments
I thought this was going to be a copy of my tutorial

Glad it's not though

Code:
http://www.warezhaven.org/seo/342782-ubuntu-rar-compress-file-into-parts-ssh.html
 
Status
Not open for further replies.
Back
Top