Skip to content
WJunction - Webmaster Forum

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

Status
Not open for further replies.
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

Wow....This Is Really A Gem of A Script...Will Def tell the Architect Abt Yu...He will surely give yu to work on the anomaly Neo...:D :D...
 
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.

About the author

A
Member · Joined
21
Messages
0
Reactions
1
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom